intergalactic 15.52.0-prerelease.0-prerelease-15fe9f5e → 15.53.0-prerelease-dfe34e97
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 +31 -4
- package/accordion/lib/cjs/Accordion.js +7 -6
- package/accordion/lib/cjs/Accordion.js.map +1 -1
- package/accordion/lib/cjs/style/accordion.shadow.css +2 -2
- package/accordion/lib/es6/Accordion.js +7 -6
- package/accordion/lib/es6/Accordion.js.map +1 -1
- package/accordion/lib/es6/style/accordion.shadow.css +2 -2
- package/components.json +12 -12
- package/d3-chart/Pattern.d.ts +336 -0
- package/d3-chart/Plot.d.ts +4 -0
- package/d3-chart/RadialTree.d.ts +7 -2
- package/d3-chart/component/Chart/AbstractChart.type.d.ts +3 -0
- package/d3-chart/component/ChartLegend/BaseLegend.type.d.ts +3 -0
- package/d3-chart/component/ChartLegend/LegendItem/LegendItem.type.d.ts +7 -1
- package/d3-chart/index.d.ts +3 -0
- package/d3-chart/lib/cjs/Area.js +25 -13
- package/d3-chart/lib/cjs/Area.js.map +1 -1
- package/d3-chart/lib/cjs/Axis.js +14 -14
- package/d3-chart/lib/cjs/Bar.js +23 -12
- package/d3-chart/lib/cjs/Bar.js.map +1 -1
- package/d3-chart/lib/cjs/Bubble.js +25 -13
- package/d3-chart/lib/cjs/Bubble.js.map +1 -1
- package/d3-chart/lib/cjs/Donut.js +28 -12
- package/d3-chart/lib/cjs/Donut.js.map +1 -1
- package/d3-chart/lib/cjs/Dots.js +55 -28
- package/d3-chart/lib/cjs/Dots.js.map +1 -1
- package/d3-chart/lib/cjs/GroupBar.js +4 -2
- package/d3-chart/lib/cjs/GroupBar.js.map +1 -1
- package/d3-chart/lib/cjs/HorizontalBar.js +23 -12
- package/d3-chart/lib/cjs/HorizontalBar.js.map +1 -1
- package/d3-chart/lib/cjs/Hover.js +9 -6
- package/d3-chart/lib/cjs/Hover.js.map +1 -1
- package/d3-chart/lib/cjs/Line.js +23 -15
- package/d3-chart/lib/cjs/Line.js.map +1 -1
- package/d3-chart/lib/cjs/Pattern.js +540 -0
- package/d3-chart/lib/cjs/Pattern.js.map +1 -0
- package/d3-chart/lib/cjs/Plot.js +7 -5
- package/d3-chart/lib/cjs/Plot.js.map +1 -1
- package/d3-chart/lib/cjs/Radar.js +126 -83
- package/d3-chart/lib/cjs/Radar.js.map +1 -1
- package/d3-chart/lib/cjs/RadialTree.js +126 -100
- package/d3-chart/lib/cjs/RadialTree.js.map +1 -1
- package/d3-chart/lib/cjs/ReferenceLine.js +9 -9
- package/d3-chart/lib/cjs/ScatterPlot.js +22 -10
- package/d3-chart/lib/cjs/ScatterPlot.js.map +1 -1
- package/d3-chart/lib/cjs/StackBar.js +8 -4
- package/d3-chart/lib/cjs/StackBar.js.map +1 -1
- package/d3-chart/lib/cjs/StackedArea.js +4 -1
- package/d3-chart/lib/cjs/StackedArea.js.map +1 -1
- package/d3-chart/lib/cjs/Tooltip.js +21 -11
- package/d3-chart/lib/cjs/Tooltip.js.map +1 -1
- package/d3-chart/lib/cjs/Venn.js +28 -12
- package/d3-chart/lib/cjs/Venn.js.map +1 -1
- package/d3-chart/lib/cjs/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/cjs/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/cjs/component/Chart/AbstractChart.js +7 -3
- package/d3-chart/lib/cjs/component/Chart/AbstractChart.js.map +1 -1
- package/d3-chart/lib/cjs/component/Chart/AbstractChart.type.js.map +1 -1
- package/d3-chart/lib/cjs/component/ChartLegend/BaseLegend.js +4 -2
- package/d3-chart/lib/cjs/component/ChartLegend/BaseLegend.js.map +1 -1
- package/d3-chart/lib/cjs/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/d3-chart/lib/cjs/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js +80 -53
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/d3-chart/lib/cjs/component/ChartLegend/LegendItem/legend-item.shadow.css +17 -3
- package/d3-chart/lib/cjs/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/lib/cjs/index.js +19 -0
- package/d3-chart/lib/cjs/index.js.map +1 -1
- package/d3-chart/lib/cjs/style/area.shadow.css +6 -1
- package/d3-chart/lib/cjs/style/bar.shadow.css +7 -1
- package/d3-chart/lib/cjs/style/bubble.shadow.css +8 -1
- package/d3-chart/lib/cjs/style/donut.shadow.css +7 -1
- package/d3-chart/lib/cjs/style/dot.shadow.css +2 -2
- package/d3-chart/lib/cjs/style/radar.shadow.css +7 -1
- package/d3-chart/lib/cjs/style/radial-tree.shadow.css +5 -0
- package/d3-chart/lib/cjs/style/scatterplot.shadow.css +8 -1
- package/d3-chart/lib/cjs/style/tooltip.shadow.css +6 -6
- package/d3-chart/lib/cjs/style/venn.shadow.css +11 -0
- package/d3-chart/lib/cjs/types/Plot.d.js.map +1 -1
- package/d3-chart/lib/cjs/types/index.d.js +12 -0
- package/d3-chart/lib/cjs/types/index.d.js.map +1 -1
- package/d3-chart/lib/es6/Area.js +25 -13
- package/d3-chart/lib/es6/Area.js.map +1 -1
- package/d3-chart/lib/es6/Axis.js +14 -14
- package/d3-chart/lib/es6/Bar.js +23 -12
- package/d3-chart/lib/es6/Bar.js.map +1 -1
- package/d3-chart/lib/es6/Bubble.js +25 -13
- package/d3-chart/lib/es6/Bubble.js.map +1 -1
- package/d3-chart/lib/es6/Donut.js +28 -12
- package/d3-chart/lib/es6/Donut.js.map +1 -1
- package/d3-chart/lib/es6/Dots.js +56 -29
- package/d3-chart/lib/es6/Dots.js.map +1 -1
- package/d3-chart/lib/es6/GroupBar.js +4 -2
- package/d3-chart/lib/es6/GroupBar.js.map +1 -1
- package/d3-chart/lib/es6/HorizontalBar.js +23 -12
- package/d3-chart/lib/es6/HorizontalBar.js.map +1 -1
- package/d3-chart/lib/es6/Hover.js +9 -6
- package/d3-chart/lib/es6/Hover.js.map +1 -1
- package/d3-chart/lib/es6/Line.js +24 -16
- package/d3-chart/lib/es6/Line.js.map +1 -1
- package/d3-chart/lib/es6/Pattern.js +534 -0
- package/d3-chart/lib/es6/Pattern.js.map +1 -0
- package/d3-chart/lib/es6/Plot.js +7 -5
- package/d3-chart/lib/es6/Plot.js.map +1 -1
- package/d3-chart/lib/es6/Radar.js +126 -83
- package/d3-chart/lib/es6/Radar.js.map +1 -1
- package/d3-chart/lib/es6/RadialTree.js +127 -101
- package/d3-chart/lib/es6/RadialTree.js.map +1 -1
- package/d3-chart/lib/es6/ReferenceLine.js +9 -9
- package/d3-chart/lib/es6/ScatterPlot.js +22 -10
- package/d3-chart/lib/es6/ScatterPlot.js.map +1 -1
- package/d3-chart/lib/es6/StackBar.js +8 -4
- package/d3-chart/lib/es6/StackBar.js.map +1 -1
- package/d3-chart/lib/es6/StackedArea.js +4 -1
- package/d3-chart/lib/es6/StackedArea.js.map +1 -1
- package/d3-chart/lib/es6/Tooltip.js +22 -11
- package/d3-chart/lib/es6/Tooltip.js.map +1 -1
- package/d3-chart/lib/es6/Venn.js +28 -12
- package/d3-chart/lib/es6/Venn.js.map +1 -1
- package/d3-chart/lib/es6/a11y/PlotA11yModule.js +2 -2
- package/d3-chart/lib/es6/a11y/PlotA11yView.js +2 -2
- package/d3-chart/lib/es6/component/Chart/AbstractChart.js +7 -3
- package/d3-chart/lib/es6/component/Chart/AbstractChart.js.map +1 -1
- package/d3-chart/lib/es6/component/Chart/AbstractChart.type.js.map +1 -1
- package/d3-chart/lib/es6/component/ChartLegend/BaseLegend.js +4 -2
- package/d3-chart/lib/es6/component/ChartLegend/BaseLegend.js.map +1 -1
- package/d3-chart/lib/es6/component/ChartLegend/BaseLegend.type.js.map +1 -1
- package/d3-chart/lib/es6/component/ChartLegend/LegendFlex/LegendFlex.js +4 -4
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js +80 -53
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.js.map +1 -1
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js +1 -1
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/LegendItem.type.js.map +1 -1
- package/d3-chart/lib/es6/component/ChartLegend/LegendItem/legend-item.shadow.css +17 -3
- package/d3-chart/lib/es6/component/ChartLegend/LegendTable/LegendTable.js +6 -6
- package/d3-chart/lib/es6/index.js +1 -0
- package/d3-chart/lib/es6/index.js.map +1 -1
- package/d3-chart/lib/es6/style/area.shadow.css +6 -1
- package/d3-chart/lib/es6/style/bar.shadow.css +7 -1
- package/d3-chart/lib/es6/style/bubble.shadow.css +8 -1
- package/d3-chart/lib/es6/style/donut.shadow.css +7 -1
- package/d3-chart/lib/es6/style/dot.shadow.css +2 -2
- package/d3-chart/lib/es6/style/radar.shadow.css +7 -1
- package/d3-chart/lib/es6/style/radial-tree.shadow.css +5 -0
- package/d3-chart/lib/es6/style/scatterplot.shadow.css +8 -1
- package/d3-chart/lib/es6/style/tooltip.shadow.css +6 -6
- package/d3-chart/lib/es6/style/venn.shadow.css +11 -0
- package/d3-chart/lib/es6/types/Plot.d.js.map +1 -1
- package/d3-chart/lib/es6/types/index.d.js +3 -0
- package/d3-chart/lib/es6/types/index.d.js.map +1 -1
- package/d3-chart/lib/types/Pattern.d.ts +336 -0
- package/d3-chart/lib/types/Plot.d.ts +4 -0
- package/d3-chart/lib/types/RadialTree.d.ts +7 -2
- package/d3-chart/lib/types/component/Chart/AbstractChart.type.d.ts +3 -0
- package/d3-chart/lib/types/component/ChartLegend/BaseLegend.type.d.ts +3 -0
- package/d3-chart/lib/types/component/ChartLegend/LegendItem/LegendItem.type.d.ts +7 -1
- package/d3-chart/lib/types/index.d.ts +3 -0
- package/date-picker/lib/cjs/components/RangePickerAbstract.js +8 -4
- package/date-picker/lib/cjs/components/RangePickerAbstract.js.map +1 -1
- package/date-picker/lib/es6/components/RangePickerAbstract.js +8 -4
- package/date-picker/lib/es6/components/RangePickerAbstract.js.map +1 -1
- package/drag-and-drop/index.d.ts +13 -2
- package/drag-and-drop/lib/cjs/DragAndDrop.js +96 -44
- package/drag-and-drop/lib/cjs/DragAndDrop.js.map +1 -1
- package/drag-and-drop/lib/cjs/index.d.js.map +1 -1
- package/drag-and-drop/lib/cjs/translations/de.json +5 -0
- package/drag-and-drop/lib/cjs/translations/en.json +5 -0
- package/drag-and-drop/lib/cjs/translations/es.json +5 -0
- package/drag-and-drop/lib/cjs/translations/fr.json +5 -0
- package/drag-and-drop/lib/cjs/translations/it.json +5 -0
- package/drag-and-drop/lib/cjs/translations/ja.json +5 -0
- package/drag-and-drop/lib/cjs/translations/ko.json +5 -0
- package/drag-and-drop/lib/cjs/translations/nl.json +5 -0
- package/drag-and-drop/lib/cjs/translations/pl.json +5 -0
- package/drag-and-drop/lib/cjs/translations/pt.json +5 -0
- package/drag-and-drop/lib/cjs/translations/sv.json +5 -0
- package/drag-and-drop/lib/cjs/translations/tr.json +5 -0
- package/drag-and-drop/lib/cjs/translations/vi.json +5 -0
- package/drag-and-drop/lib/cjs/translations/zh.json +5 -0
- package/drag-and-drop/lib/es6/DragAndDrop.js +96 -44
- package/drag-and-drop/lib/es6/DragAndDrop.js.map +1 -1
- package/drag-and-drop/lib/es6/index.d.js.map +1 -1
- package/drag-and-drop/lib/es6/translations/de.json +5 -0
- package/drag-and-drop/lib/es6/translations/en.json +5 -0
- package/drag-and-drop/lib/es6/translations/es.json +5 -0
- package/drag-and-drop/lib/es6/translations/fr.json +5 -0
- package/drag-and-drop/lib/es6/translations/it.json +5 -0
- package/drag-and-drop/lib/es6/translations/ja.json +5 -0
- package/drag-and-drop/lib/es6/translations/ko.json +5 -0
- package/drag-and-drop/lib/es6/translations/nl.json +5 -0
- package/drag-and-drop/lib/es6/translations/pl.json +5 -0
- package/drag-and-drop/lib/es6/translations/pt.json +5 -0
- package/drag-and-drop/lib/es6/translations/sv.json +5 -0
- package/drag-and-drop/lib/es6/translations/tr.json +5 -0
- package/drag-and-drop/lib/es6/translations/vi.json +5 -0
- package/drag-and-drop/lib/es6/translations/zh.json +5 -0
- package/drag-and-drop/lib/types/index.d.ts +13 -2
- package/package.json +3 -3
- package/pills/lib/cjs/Pills.js +44 -57
- package/pills/lib/cjs/Pills.js.map +1 -1
- package/pills/lib/cjs/style/pills.shadow.css +3 -9
- package/pills/lib/es6/Pills.js +44 -57
- package/pills/lib/es6/Pills.js.map +1 -1
- package/pills/lib/es6/style/pills.shadow.css +3 -9
- package/utils/lib/enhances/a11yEnhance.d.ts +9 -3
- package/utils/lib/enhances/a11yEnhance.js +11 -11
- package/utils/lib/enhances/a11yEnhance.js.map +1 -1
- package/utils/lib/enhances/a11yEnhance.mjs +11 -11
- package/utils/lib/enhances/a11yEnhance.mjs.map +1 -1
- package/utils/lib/themes/auto.css +3 -3
- package/utils/lib/themes/dark.css +2 -2
- package/utils/lib/themes/dark.json +1 -1
- package/utils/lib/themes/default.css +1 -1
- package/utils/lib/themes/light.css +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AbstractChart.type.js","names":[],"sources":["../../../../src/component/Chart/AbstractChart.type.ts"],"sourcesContent":["import React from 'react';\nimport { FlexProps } from '@semcore/flex-box';\nimport { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\nimport Icon from '@semcore/icon';\nimport { BaseChartLegendProps } from '../ChartLegend/BaseLegend.type';\nimport { TrendProps } from '../ChartLegend/LegendFlex/LegendFlex.type';\n\nexport type BaseLegendProps = BaseChartLegendProps & {\n /**\n * Disable hover (for transition items legend of each not hovered)\n */\n disableHoverItems?: boolean;\n /**\n * Disable selectable of data items by checkboxes in Legend\n */\n disableSelectItems?: boolean;\n} & (\n | (TrendProps & {\n /**\n * How to render Legend - Flex view. Just list of legend items\n */\n legendType?: never | 'Flex';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Flex'>;\n })\n | {\n /**\n * How to render Legend - Table view. Table of legend items with some additional information in columns\n */\n legendType: 'Table';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Table'>;\n }\n );\n\nexport type ObjectData = Record<string, unknown>;\nexport type ListData = ObjectData[];\n\nexport type BaseChartProps<T extends ListData | ObjectData> = FlexProps & {\n /**\n * Chart data. For all charts except Donut(Pie), Radar and Venn should be an Array\n */\n data: T;\n /**\n * Width of plot\n */\n plotWidth: number;\n /**\n * Height of plot\n */\n plotHeight: number;\n /**\n * Margin (for Y axis points) from left side of chart container to Y axis\n */\n marginY?: number;\n /**\n * Margin (for X axis points) from bottom of chart container to X axis\n */\n marginX?: number;\n /**\n * invert axis and show horizontal charts (only for Bars!)\n */\n invertAxis?: boolean;\n\n /**\n * Show X axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showXAxis?: boolean;\n /**\n * Show Y axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showYAxis?: boolean;\n /**\n * Map with colors for data items\n */\n colorMap?: Record<string, string>;\n /**\n * Show tooltip's.\n * @default true\n */\n showTooltip?: boolean;\n /**\n * Show sum of values for selected point in tooltip\n */\n showTotalInTooltip?: boolean;\n /**\n * Scale for xAxis (see more in d3-scale)\n */\n xScale?: unknown;\n /**\n * Scale for yAxis (see more in d3-scale)\n */\n yScale?: unknown;\n /**\n * Count of ticks for X axis\n */\n xTicksCount?: number;\n /**\n * Count of ticks for Y axis\n */\n yTicksCount?: number;\n /**\n * Group key for all array-based charts (for get keys of items for legend except that group key)\n */\n groupKey?: string;\n /**\n * function for format axis item text\n */\n axisXValueFormatter?: (value: unknown) => string;\n axisYValueFormatter?: (value: unknown) => string;\n /**\n * Function for format text for tooltip\n */\n tooltipValueFormatter?: (value?: unknown) => string;\n} /**\n * By default, we show the Legend for all charts with more the one data item.\n * For hide the Legend, you should set showLegend prop to `false`.\n */ & (\n | {\n /**\n * Don't show legend\n */\n showLegend?: false;\n legendProps?: never;\n }\n | {\n /**\n * By default (if showLegend don't set), for one data item on chart,\n * Legend component will be hide, and show for more then 1 data item.\n * If set `true` - Legend component will show always.\n */\n showLegend?: true;\n /**\n * Props for Legend\n */\n legendProps?: Partial<BaseLegendProps>;\n }\n );\n\ntype LegendDataMap<T extends 'Flex' | 'Table'> = Record<\n LegendItemKey,\n {\n /**\n * Custom label for legend item (by default use keys from data item object)\n */\n label?: string;\n /**\n * Additional text after label\n */\n additionalInfo?: string;\n /**\n * Count after label\n */\n count?: number;\n /**\n * Custom Icon\n */\n icon?: typeof Icon;\n /**\n * Flag for uncheck some items by default\n */\n defaultChecked?: boolean;\n } & (T extends 'Table' ? { columns?: React.ReactNode[] } : { columns?: never })\n>;\n"],"mappings":""}
|
1
|
+
{"version":3,"file":"AbstractChart.type.js","names":[],"sources":["../../../../src/component/Chart/AbstractChart.type.ts"],"sourcesContent":["import React from 'react';\nimport { FlexProps } from '@semcore/flex-box';\nimport { LegendItemKey } from '../ChartLegend/LegendItem/LegendItem.type';\nimport Icon from '@semcore/icon';\nimport { BaseChartLegendProps } from '../ChartLegend/BaseLegend.type';\nimport { TrendProps } from '../ChartLegend/LegendFlex/LegendFlex.type';\nimport { PatternsConfig } from '../../Pattern';\n\nexport type BaseLegendProps = BaseChartLegendProps & {\n /**\n * Disable hover (for transition items legend of each not hovered)\n */\n disableHoverItems?: boolean;\n /**\n * Disable selectable of data items by checkboxes in Legend\n */\n disableSelectItems?: boolean;\n} & (\n | (TrendProps & {\n /**\n * How to render Legend - Flex view. Just list of legend items\n */\n legendType?: never | 'Flex';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Flex'>;\n })\n | {\n /**\n * How to render Legend - Table view. Table of legend items with some additional information in columns\n */\n legendType: 'Table';\n /**\n * Config for Legend items\n */\n legendMap?: LegendDataMap<'Table'>;\n }\n );\n\nexport type ObjectData = Record<string, unknown>;\nexport type ListData = ObjectData[];\n\nexport type BaseChartProps<T extends ListData | ObjectData> = FlexProps & {\n /**\n * Chart data. For all charts except Donut(Pie), Radar and Venn should be an Array\n */\n data: T;\n /**\n * Width of plot\n */\n plotWidth: number;\n /**\n * Height of plot\n */\n plotHeight: number;\n\n /** Enables charts patterns that enhances charts accessability */\n patterns?: PatternsConfig;\n /**\n * Margin (for Y axis points) from left side of chart container to Y axis\n */\n marginY?: number;\n /**\n * Margin (for X axis points) from bottom of chart container to X axis\n */\n marginX?: number;\n /**\n * invert axis and show horizontal charts (only for Bars!)\n */\n invertAxis?: boolean;\n\n /**\n * Show X axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showXAxis?: boolean;\n /**\n * Show Y axis\n * @default true (for charts with axis: Area, Line, Bar, ScatterPlot, ...)\n */\n showYAxis?: boolean;\n /**\n * Map with colors for data items\n */\n colorMap?: Record<string, string>;\n /**\n * Show tooltip's.\n * @default true\n */\n showTooltip?: boolean;\n /**\n * Show sum of values for selected point in tooltip\n */\n showTotalInTooltip?: boolean;\n /**\n * Scale for xAxis (see more in d3-scale)\n */\n xScale?: unknown;\n /**\n * Scale for yAxis (see more in d3-scale)\n */\n yScale?: unknown;\n /**\n * Count of ticks for X axis\n */\n xTicksCount?: number;\n /**\n * Count of ticks for Y axis\n */\n yTicksCount?: number;\n /**\n * Group key for all array-based charts (for get keys of items for legend except that group key)\n */\n groupKey?: string;\n /**\n * function for format axis item text\n */\n axisXValueFormatter?: (value: unknown) => string;\n axisYValueFormatter?: (value: unknown) => string;\n /**\n * Function for format text for tooltip\n */\n tooltipValueFormatter?: (value?: unknown) => string;\n} /**\n * By default, we show the Legend for all charts with more the one data item.\n * For hide the Legend, you should set showLegend prop to `false`.\n */ & (\n | {\n /**\n * Don't show legend\n */\n showLegend?: false;\n legendProps?: never;\n }\n | {\n /**\n * By default (if showLegend don't set), for one data item on chart,\n * Legend component will be hide, and show for more then 1 data item.\n * If set `true` - Legend component will show always.\n */\n showLegend?: true;\n /**\n * Props for Legend\n */\n legendProps?: Partial<BaseLegendProps>;\n }\n );\n\ntype LegendDataMap<T extends 'Flex' | 'Table'> = Record<\n LegendItemKey,\n {\n /**\n * Custom label for legend item (by default use keys from data item object)\n */\n label?: string;\n /**\n * Additional text after label\n */\n additionalInfo?: string;\n /**\n * Count after label\n */\n count?: number;\n /**\n * Custom Icon\n */\n icon?: typeof Icon;\n /**\n * Flag for uncheck some items by default\n */\n defaultChecked?: boolean;\n } & (T extends 'Table' ? { columns?: React.ReactNode[] } : { columns?: never })\n>;\n"],"mappings":""}
|
@@ -87,7 +87,8 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
87
87
|
_this$asProps2$shape = _this$asProps2.shape,
|
88
88
|
shape = _this$asProps2$shape === void 0 ? 'Checkbox' : _this$asProps2$shape,
|
89
89
|
_this$asProps2$size = _this$asProps2.size,
|
90
|
-
size = _this$asProps2$size === void 0 ? 'm' : _this$asProps2$size
|
90
|
+
size = _this$asProps2$size === void 0 ? 'm' : _this$asProps2$size,
|
91
|
+
patterns = _this$asProps2.patterns;
|
91
92
|
var line = this.getItem(index);
|
92
93
|
return (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, line), {}, {
|
93
94
|
shape: shape,
|
@@ -98,7 +99,8 @@ var BaseLegend = /*#__PURE__*/function (_Component) {
|
|
98
99
|
style: {
|
99
100
|
gridRowStart: "".concat(index + 1),
|
100
101
|
gridRowEnd: "".concat(index + 2)
|
101
|
-
}
|
102
|
+
},
|
103
|
+
patterns: patterns
|
102
104
|
});
|
103
105
|
}
|
104
106
|
}]);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseLegend.js","names":["_core","require","_hints","BaseLegend","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","id","item","asProps","items","find","_this$props$onChangeV","_this$props","checked","props","onChangeVisibleItem","e","_this$props$onMouseEn","_this$props2","onMouseEnterItem","_this$props$onMouseLe","_this$props3","onMouseLeaveItem","_createClass2","key","value","componentDidMount","setHints","componentDidUpdate","prevProps","dataHints","_this$asProps","dataHintsHandler","makeDataHintsHandlers","undefined","forEach","legendItem","labelKey","label","getItem","index","line","Error","getLegendItemProps","_","_this$asProps2","_this$asProps2$shape","shape","_this$asProps2$size","size","_objectSpread2","onClick","bindOnChange","onMouseEnter","bindOnMouseEnterItem","onMouseLeave","bindOnMouseLeaveItem","style","gridRowStart","gridRowEnd","Component","exports"],"sources":["../../../../src/component/ChartLegend/BaseLegend.tsx"],"sourcesContent":["import React from 'react';\nimport { Component, Intergalactic } from '@semcore/core';\nimport { LegendItemKey, LegendItemProps } from './LegendItem/LegendItem.type';\nimport { LegendProps } from './BaseLegend.type';\nimport { makeDataHintsHandlers } from '../../a11y/hints';\n\nexport abstract class BaseLegend<T extends LegendProps> extends Component<T> {\n componentDidMount() {\n this.setHints();\n }\n\n componentDidUpdate(prevProps: T) {\n if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {\n this.setHints();\n }\n }\n\n setHints() {\n const { items, dataHints } = this.asProps;\n const dataHintsHandler = dataHints ? makeDataHintsHandlers(dataHints) : undefined;\n\n items.forEach((legendItem) => {\n dataHintsHandler?.labelKey('value', legendItem.id, legendItem.label);\n });\n }\n\n getItem(index: number) {\n const line = this.asProps.items[index];\n\n if (line === undefined) {\n throw new Error(`No index \"${index}\" in lines`);\n }\n\n return line;\n }\n\n getLegendItemProps(\n _: {},\n index: number,\n ): LegendItemProps & Intergalactic.InternalTypings.ComponentPropsNesting<'div'> {\n const { shape = 'Checkbox', size = 'm' } = this.asProps;\n const line = this.getItem(index);\n\n return {\n ...line,\n shape,\n size,\n onClick: this.bindOnChange(line.id),\n onMouseEnter: this.bindOnMouseEnterItem(line.id),\n onMouseLeave: this.bindOnMouseLeaveItem(line.id),\n style: { gridRowStart: `${index + 1}`, gridRowEnd: `${index + 2}` },\n };\n }\n\n bindOnChange = (id: LegendItemKey) => {\n const item = this.asProps.items.find((item) => item.id === id);\n\n return () => {\n const checked = !item?.checked;\n\n this.props.onChangeVisibleItem?.(id, checked);\n };\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":";;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAAyD,IAEnCE,UAAU,0BAAAC,UAAA;EAAA,IAAAC,UAAA,aAAAF,UAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,UAAA;EAAA,SAAAA,WAAA;IAAA,IAAAK,KAAA;IAAA,IAAAC,gBAAA,mBAAAN,UAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAL,IAAA;IAAA,IAAAM,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,
|
1
|
+
{"version":3,"file":"BaseLegend.js","names":["_core","require","_hints","BaseLegend","_Component","_inherits2","_super","_createSuper2","_this","_classCallCheck2","_len","arguments","length","args","Array","_key","call","apply","concat","_defineProperty2","_assertThisInitialized2","id","item","asProps","items","find","_this$props$onChangeV","_this$props","checked","props","onChangeVisibleItem","e","_this$props$onMouseEn","_this$props2","onMouseEnterItem","_this$props$onMouseLe","_this$props3","onMouseLeaveItem","_createClass2","key","value","componentDidMount","setHints","componentDidUpdate","prevProps","dataHints","_this$asProps","dataHintsHandler","makeDataHintsHandlers","undefined","forEach","legendItem","labelKey","label","getItem","index","line","Error","getLegendItemProps","_","_this$asProps2","_this$asProps2$shape","shape","_this$asProps2$size","size","patterns","_objectSpread2","onClick","bindOnChange","onMouseEnter","bindOnMouseEnterItem","onMouseLeave","bindOnMouseLeaveItem","style","gridRowStart","gridRowEnd","Component","exports"],"sources":["../../../../src/component/ChartLegend/BaseLegend.tsx"],"sourcesContent":["import React from 'react';\nimport { Component, Intergalactic } from '@semcore/core';\nimport { LegendItemKey, LegendItemProps } from './LegendItem/LegendItem.type';\nimport { LegendProps } from './BaseLegend.type';\nimport { makeDataHintsHandlers } from '../../a11y/hints';\n\nexport abstract class BaseLegend<T extends LegendProps> extends Component<T> {\n componentDidMount() {\n this.setHints();\n }\n\n componentDidUpdate(prevProps: T) {\n if (prevProps.items !== this.props.items || prevProps.dataHints !== this.props.dataHints) {\n this.setHints();\n }\n }\n\n setHints() {\n const { items, dataHints } = this.asProps;\n const dataHintsHandler = dataHints ? makeDataHintsHandlers(dataHints) : undefined;\n\n items.forEach((legendItem) => {\n dataHintsHandler?.labelKey('value', legendItem.id, legendItem.label);\n });\n }\n\n getItem(index: number) {\n const line = this.asProps.items[index];\n\n if (line === undefined) {\n throw new Error(`No index \"${index}\" in lines`);\n }\n\n return line;\n }\n\n getLegendItemProps(\n _: {},\n index: number,\n ): LegendItemProps & Intergalactic.InternalTypings.ComponentPropsNesting<'div'> {\n const { shape = 'Checkbox', size = 'm', patterns } = this.asProps;\n const line = this.getItem(index);\n\n return {\n ...line,\n shape,\n size,\n onClick: this.bindOnChange(line.id),\n onMouseEnter: this.bindOnMouseEnterItem(line.id),\n onMouseLeave: this.bindOnMouseLeaveItem(line.id),\n style: { gridRowStart: `${index + 1}`, gridRowEnd: `${index + 2}` },\n patterns,\n };\n }\n\n bindOnChange = (id: LegendItemKey) => {\n const item = this.asProps.items.find((item) => item.id === id);\n\n return () => {\n const checked = !item?.checked;\n\n this.props.onChangeVisibleItem?.(id, checked);\n };\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":";;;;;;;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AAGA,IAAAC,MAAA,GAAAD,OAAA;AAAyD,IAEnCE,UAAU,0BAAAC,UAAA;EAAA,IAAAC,UAAA,aAAAF,UAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,UAAA;EAAA,SAAAA,WAAA;IAAA,IAAAK,KAAA;IAAA,IAAAC,gBAAA,mBAAAN,UAAA;IAAA,SAAAO,IAAA,GAAAC,SAAA,CAAAC,MAAA,EAAAC,IAAA,OAAAC,KAAA,CAAAJ,IAAA,GAAAK,IAAA,MAAAA,IAAA,GAAAL,IAAA,EAAAK,IAAA;MAAAF,IAAA,CAAAE,IAAA,IAAAJ,SAAA,CAAAI,IAAA;IAAA;IAAAP,KAAA,GAAAF,MAAA,CAAAU,IAAA,CAAAC,KAAA,CAAAX,MAAA,SAAAY,MAAA,CAAAL,IAAA;IAAA,IAAAM,gBAAA,iBAAAC,uBAAA,aAAAZ,KAAA,mBAiDf,UAACa,EAAiB,EAAK;MACpC,IAAMC,IAAI,GAAGd,KAAA,CAAKe,OAAO,CAACC,KAAK,CAACC,IAAI,CAAC,UAACH,IAAI;QAAA,OAAKA,IAAI,CAACD,EAAE,KAAKA,EAAE;MAAA,EAAC;MAE9D,OAAO,YAAM;QAAA,IAAAK,qBAAA,EAAAC,WAAA;QACX,IAAMC,OAAO,GAAG,EAACN,IAAI,aAAJA,IAAI,eAAJA,IAAI,CAAEM,OAAO;QAE9B,CAAAF,qBAAA,IAAAC,WAAA,GAAAnB,KAAA,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AK,EAALA,KAAK;QACLE,IAAI,EAAJA,IAAI;QACJG,OAAO,EAAE,IAAI,CAACC,YAAY,CAACZ,IAAI,CAACnC,EAAE,CAAC;QACnCgD,YAAY,EAAE,IAAI,CAACC,oBAAoB,CAACd,IAAI,CAACnC,EAAE,CAAC;QAChDkD,YAAY,EAAE,IAAI,CAACC,oBAAoB,CAAChB,IAAI,CAACnC,EAAE,CAAC;QAChDoD,KAAK,EAAE;UAAEC,YAAY,KAAAxD,MAAA,CAAKqC,KAAK,GAAG,CAAC,CAAE;UAAEoB,UAAU,KAAAzD,MAAA,CAAKqC,KAAK,GAAG,CAAC;QAAG,CAAC;QACnEU,QAAQ,EAARA;MAAQ;IAEZ;EAAC;EAAA,OAAA9D,UAAA;AAAA,EA/C6DyE,eAAS;AAAAC,OAAA,CAAA1E,UAAA,GAAAA,UAAA"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import { BoxProps, FlexProps } from '@semcore/flex-box';\nimport { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport { DataStructureHints } from '../../a11y/hints';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = FlexProps & {\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"],"mappings":""}
|
1
|
+
{"version":3,"file":"BaseLegend.type.js","names":[],"sources":["../../../../src/component/ChartLegend/BaseLegend.type.ts"],"sourcesContent":["import { BoxProps, FlexProps } from '@semcore/flex-box';\nimport { LegendItem, LegendItemKey, ShapeType } from './LegendItem/LegendItem.type';\nimport { DataStructureHints } from '../../a11y/hints';\nimport type { PatternsConfig } from '../../Pattern';\n\nexport type LSize = 'm' | 'l';\n\nexport type BaseChartLegendProps = FlexProps & {\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 accessability */\n patterns?: PatternsConfig;\n };\n"],"mappings":""}
|
@@ -22,10 +22,10 @@ var _BaseLegend2 = require("../BaseLegend");
|
|
22
22
|
var _intergalacticDynamicLocales = require("../../../translations/__intergalactic-dynamic-locales");
|
23
23
|
var _i18nEnhance = _interopRequireDefault(require("intergalactic/utils/lib/enhances/i18nEnhance"));
|
24
24
|
/*__reshadow-styles__:"./legend-flex.shadow.css"*/
|
25
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
26
|
-
"__SLegendFlex": "
|
27
|
-
"_direction_row": "
|
28
|
-
"_direction_column": "
|
25
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendFlex_1yvn1_gg_._direction_row_1yvn1_gg_{align-items:center;flex-wrap:wrap;gap:8px 16px}.___SLegendFlex_1yvn1_gg_._direction_column_1yvn1_gg_{align-items:flex-start;flex-wrap:wrap;gap:8px}" /*__inner_css_end__*/, "1yvn1_gg_") /*__reshadow_css_end__*/, {
|
26
|
+
"__SLegendFlex": "___SLegendFlex_1yvn1_gg_",
|
27
|
+
"_direction_row": "_direction_row_1yvn1_gg_",
|
28
|
+
"_direction_column": "_direction_column_1yvn1_gg_"
|
29
29
|
});
|
30
30
|
var LegendFlexRoot = /*#__PURE__*/function (_BaseLegend) {
|
31
31
|
(0, _inherits2["default"])(LegendFlexRoot, _BaseLegend);
|
@@ -20,23 +20,27 @@ var _checkbox = _interopRequireDefault(require("intergalactic/checkbox"));
|
|
20
20
|
var _typography = require("intergalactic/typography");
|
21
21
|
var _LegendItem = require("./LegendItem.type");
|
22
22
|
var _resolveColorEnhance = _interopRequireDefault(require("intergalactic/utils/lib/enhances/resolveColorEnhance"));
|
23
|
+
var _Pattern = require("../../../Pattern");
|
24
|
+
var _utils = require("../../../utils");
|
23
25
|
var _excluded = ["color"];
|
24
26
|
/*__reshadow-styles__:"./legend-item.shadow.css"*/
|
25
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
26
|
-
"__SLegendItem": "
|
27
|
-
"_disabled": "
|
28
|
-
"__SPointShape": "
|
29
|
-
"_color": "
|
30
|
-
"--color": "--
|
31
|
-
"_shape_Circle": "
|
32
|
-
"_size_l": "
|
33
|
-
"_size_m": "
|
34
|
-
"_shape_Line": "
|
35
|
-
"_shape_Square": "
|
36
|
-
"
|
37
|
-
"
|
38
|
-
"
|
39
|
-
"
|
27
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendItem_siahs_gg_{min-width:0;align-items:flex-start}@media (hover:hover){.___SLegendItem_siahs_gg_:hover{cursor:pointer}.___SLegendItem_siahs_gg_.__disabled_siahs_gg_:hover{cursor:default}}.___SPointShape_siahs_gg_.__color_siahs_gg_{background-color:var(--color_siahs);margin-right:8px;flex-shrink:0}.___SPointShape_siahs_gg_._shape_Circle_siahs_gg_._size_l_siahs_gg_{width:16px;height:16px;border-radius:8px;margin-top:4px}.___SPointShape_siahs_gg_._shape_Circle_siahs_gg_._size_m_siahs_gg_{width:12px;height:12px;border-radius:6px;margin-top:4px}.___SPointShape_siahs_gg_._shape_Line_siahs_gg_._size_l_siahs_gg_{width:16px;height:4px;border-radius:3px;margin-top:9px}.___SPointShape_siahs_gg_._shape_Line_siahs_gg_._size_m_siahs_gg_{width:12px;height:4px;border-radius:3px;margin-top:8px}.___SPointShape_siahs_gg_._shape_Square_siahs_gg_._size_l_siahs_gg_{width:16px;height:16px;border-radius:2px;margin-top:4px}.___SPointShape_siahs_gg_._shape_Square_siahs_gg_._size_m_siahs_gg_{width:12px;height:12px;border-radius:2px;margin-top:4px}.___SPointShape_siahs_gg_._shape_Pattern_siahs_gg_{background-color:transparent;margin-right:4px}.___SIcon_siahs_gg_{line-height:0;margin-right:4px}.___SIcon_siahs_gg_._size_l_siahs_gg_{margin-top:4px}.___SIcon_siahs_gg_._size_m_siahs_gg_{margin-top:2px}.___SLabel_siahs_gg_{min-width:0}.___SAdditionalLabel_siahs_gg_._size_l_siahs_gg_,.___SCount_siahs_gg_._size_l_siahs_gg_,.___SLabel_siahs_gg_._size_l_siahs_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%)}.___SAdditionalLabel_siahs_gg_._size_m_siahs_gg_,.___SCount_siahs_gg_._size_m_siahs_gg_,.___SLabel_siahs_gg_._size_m_siahs_gg_{font-size:var(--intergalactic-fs-200, 14px);line-height:var(--intergalactic-lh-200, 142%)}.___SAdditionalLabel_siahs_gg_,.___SCount_siahs_gg_{margin-left:4px}.___SAdditionalLabel_siahs_gg_{white-space:nowrap;display:flex;align-items:flex-start}.___SAdditionalLabel_siahs_gg_::before{content:\"\";display:inline-block;background-color:var(--intergalactic-text-secondary, #6c6e79);height:4px;width:4px;border-radius:2px;margin-right:4px}.___SAdditionalLabel_siahs_gg_._size_l_siahs_gg_::before{margin-top:10px}.___SAdditionalLabel_siahs_gg_._size_m_siahs_gg_::before{margin-top:8px}.___SPatternSymbol_siahs_gg_{transform:scale(.8)}" /*__inner_css_end__*/, "siahs_gg_") /*__reshadow_css_end__*/, {
|
28
|
+
"__SLegendItem": "___SLegendItem_siahs_gg_",
|
29
|
+
"_disabled": "__disabled_siahs_gg_",
|
30
|
+
"__SPointShape": "___SPointShape_siahs_gg_",
|
31
|
+
"_color": "__color_siahs_gg_",
|
32
|
+
"--color": "--color_siahs",
|
33
|
+
"_shape_Circle": "_shape_Circle_siahs_gg_",
|
34
|
+
"_size_l": "_size_l_siahs_gg_",
|
35
|
+
"_size_m": "_size_m_siahs_gg_",
|
36
|
+
"_shape_Line": "_shape_Line_siahs_gg_",
|
37
|
+
"_shape_Square": "_shape_Square_siahs_gg_",
|
38
|
+
"_shape_Pattern": "_shape_Pattern_siahs_gg_",
|
39
|
+
"__SIcon": "___SIcon_siahs_gg_",
|
40
|
+
"__SLabel": "___SLabel_siahs_gg_",
|
41
|
+
"__SAdditionalLabel": "___SAdditionalLabel_siahs_gg_",
|
42
|
+
"__SCount": "___SCount_siahs_gg_",
|
43
|
+
"__SPatternSymbol": "___SPatternSymbol_siahs_gg_"
|
40
44
|
});
|
41
45
|
var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
42
46
|
(0, _inherits2["default"])(LegendItemRoot, _Component);
|
@@ -56,13 +60,16 @@ var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
56
60
|
id = _this$asProps.id,
|
57
61
|
size = _this$asProps.size,
|
58
62
|
onClick = _this$asProps.onClick,
|
59
|
-
resolveColor = _this$asProps.resolveColor
|
63
|
+
resolveColor = _this$asProps.resolveColor,
|
64
|
+
patterns = _this$asProps.patterns;
|
60
65
|
return {
|
61
66
|
id: id,
|
62
67
|
label: label,
|
63
68
|
shape: shape,
|
64
69
|
checked: checked,
|
65
70
|
color: resolveColor(color),
|
71
|
+
patternKey: color,
|
72
|
+
patterns: patterns,
|
66
73
|
size: size,
|
67
74
|
onKeyUp: function onKeyUp(e) {
|
68
75
|
if (onClick && e.key === ' ') {
|
@@ -137,89 +144,109 @@ var LegendItemRoot = /*#__PURE__*/function (_Component) {
|
|
137
144
|
});
|
138
145
|
function Shape(props) {
|
139
146
|
var _ref2 = arguments[0],
|
140
|
-
|
147
|
+
_ref10;
|
141
148
|
var SPointShape = _flexBox.Box;
|
149
|
+
var SPatternSymbol = _Pattern.PatternSymbol;
|
142
150
|
var styles = props.styles,
|
143
151
|
size = props.size,
|
144
152
|
shape = props.shape,
|
145
153
|
checked = props.checked,
|
146
154
|
color = props.color,
|
155
|
+
_props$patternKey = props.patternKey,
|
156
|
+
patternKey = _props$patternKey === void 0 ? (0, _utils.getChartDefaultColorName)(0) : _props$patternKey,
|
147
157
|
Children = props.Children,
|
148
158
|
hasChildren = props.children,
|
149
159
|
onKeyUp = props.onKeyUp,
|
150
|
-
label = props.label
|
160
|
+
label = props.label,
|
161
|
+
patterns = props.patterns;
|
151
162
|
if (hasChildren) {
|
152
163
|
return /*#__PURE__*/_react["default"].createElement(Children, null);
|
153
164
|
}
|
165
|
+
if (shape === 'Pattern') {
|
166
|
+
var _ref8;
|
167
|
+
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_flexBox.Box, _ref8.cn("Box", {
|
168
|
+
"mr": 1
|
169
|
+
}), /*#__PURE__*/_react["default"].createElement(SPatternSymbol, _ref8.cn("SPatternSymbol", {
|
170
|
+
"color": color,
|
171
|
+
"patternKey": patternKey
|
172
|
+
})));
|
173
|
+
}
|
154
174
|
if (shape === 'Checkbox') {
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
175
|
+
var _ref9;
|
176
|
+
return _ref9 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, /*#__PURE__*/_react["default"].createElement(_checkbox["default"], _ref9.cn("Checkbox", {
|
177
|
+
"size": size,
|
178
|
+
"checked": checked,
|
179
|
+
"theme": checked ? color : undefined,
|
180
|
+
"onKeyUp": onKeyUp,
|
160
181
|
"aria-label": label
|
161
|
-
})
|
182
|
+
})), patterns && /*#__PURE__*/_react["default"].createElement(_flexBox.Box, _ref9.cn("Box", {
|
183
|
+
"mt": '2px',
|
184
|
+
"mr": 1
|
185
|
+
}), /*#__PURE__*/_react["default"].createElement(SPatternSymbol, _ref9.cn("SPatternSymbol", {
|
186
|
+
"color": color,
|
187
|
+
"patternKey": patternKey
|
188
|
+
}))));
|
162
189
|
}
|
163
|
-
return
|
190
|
+
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SPointShape, _ref10.cn("SPointShape", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({}, _ref2))), /*#__PURE__*/_react["default"].createElement(Children, _ref10.cn("Children", {})));
|
164
191
|
}
|
165
|
-
function Icon(
|
192
|
+
function Icon(_ref15) {
|
166
193
|
var _ref3 = arguments[0],
|
167
|
-
|
168
|
-
var styles =
|
169
|
-
hasChildren =
|
170
|
-
Children =
|
194
|
+
_ref11;
|
195
|
+
var styles = _ref15.styles,
|
196
|
+
hasChildren = _ref15.children,
|
197
|
+
Children = _ref15.Children;
|
171
198
|
var SIcon = _flexBox.Box;
|
172
199
|
if (!hasChildren) {
|
173
200
|
return null;
|
174
201
|
}
|
175
|
-
return
|
202
|
+
return _ref11 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SIcon, _ref11.cn("SIcon", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
176
203
|
"tag": 'span'
|
177
|
-
}, _ref3))), /*#__PURE__*/_react["default"].createElement(Children,
|
204
|
+
}, _ref3))), /*#__PURE__*/_react["default"].createElement(Children, _ref11.cn("Children", {})));
|
178
205
|
}
|
179
206
|
Icon.displayName = 'Icon';
|
180
|
-
function Label(
|
207
|
+
function Label(_ref16) {
|
181
208
|
var _ref4 = arguments[0],
|
182
|
-
|
183
|
-
var styles =
|
184
|
-
hasChildren =
|
185
|
-
Children =
|
209
|
+
_ref12;
|
210
|
+
var styles = _ref16.styles,
|
211
|
+
hasChildren = _ref16.children,
|
212
|
+
Children = _ref16.Children;
|
186
213
|
var SLabel = _typography.Text;
|
187
214
|
if (!hasChildren) {
|
188
215
|
return null;
|
189
216
|
}
|
190
|
-
return
|
217
|
+
return _ref12 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SLabel, _ref12.cn("SLabel", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
191
218
|
"use": 'primary'
|
192
|
-
}, _ref4))), /*#__PURE__*/_react["default"].createElement(Children,
|
219
|
+
}, _ref4))), /*#__PURE__*/_react["default"].createElement(Children, _ref12.cn("Children", {})));
|
193
220
|
}
|
194
221
|
Label.displayName = 'Label';
|
195
|
-
function AdditionalLabel(
|
222
|
+
function AdditionalLabel(_ref17) {
|
196
223
|
var _ref5 = arguments[0],
|
197
|
-
|
198
|
-
var styles =
|
199
|
-
hasChildren =
|
200
|
-
Children =
|
224
|
+
_ref13;
|
225
|
+
var styles = _ref17.styles,
|
226
|
+
hasChildren = _ref17.children,
|
227
|
+
Children = _ref17.Children;
|
201
228
|
var SAdditionalLabel = _typography.Text;
|
202
229
|
if (!hasChildren) {
|
203
230
|
return null;
|
204
231
|
}
|
205
|
-
return
|
232
|
+
return _ref13 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SAdditionalLabel, _ref13.cn("SAdditionalLabel", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
206
233
|
"use": 'secondary'
|
207
|
-
}, _ref5))), /*#__PURE__*/_react["default"].createElement(Children,
|
234
|
+
}, _ref5))), /*#__PURE__*/_react["default"].createElement(Children, _ref13.cn("Children", {})));
|
208
235
|
}
|
209
236
|
AdditionalLabel.displayName = 'AdditionalLabel';
|
210
|
-
function Count(
|
237
|
+
function Count(_ref18) {
|
211
238
|
var _ref6 = arguments[0],
|
212
|
-
|
213
|
-
var styles =
|
214
|
-
hasChildren =
|
215
|
-
Children =
|
239
|
+
_ref14;
|
240
|
+
var styles = _ref18.styles,
|
241
|
+
hasChildren = _ref18.children,
|
242
|
+
Children = _ref18.Children;
|
216
243
|
var SCount = _typography.Text;
|
217
244
|
if (!hasChildren) {
|
218
245
|
return null;
|
219
246
|
}
|
220
|
-
return
|
247
|
+
return _ref14 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCount, _ref14.cn("SCount", (0, _objectSpread2["default"])({}, (0, _core.assignProps)({
|
221
248
|
"use": 'secondary'
|
222
|
-
}, _ref6))), /*#__PURE__*/_react["default"].createElement(Children,
|
249
|
+
}, _ref6))), /*#__PURE__*/_react["default"].createElement(Children, _ref14.cn("Children", {})));
|
223
250
|
}
|
224
251
|
Count.displayName = 'Count';
|
225
252
|
var LegendItemComponent = (0, _core["default"])(LegendItemRoot, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendItem.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_checkbox","_typography","_LegendItem","_resolveColorEnhance","_excluded","style","sstyled","insert","LegendItemRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","getShapeProps","_this$asProps","asProps","checked","color","shape","label","id","size","onClick","resolveColor","onKeyUp","e","getIconProps","props","_objectSpread2","children","icon","getLabelProps","_this$asProps2","_objectWithoutProperties2","getAdditionalLabelProps","additionalInfo","concat","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","_this$asProps3","styles","Children","disabled","StaticShapes","includes","createElement","cn","assignProps","Component","_defineProperty2","resolveColorEnhance","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref8","SPointShape","Box","hasChildren","theme","_ref13","_ref3","_ref9","SIcon","displayName","_ref14","_ref4","_ref10","SLabel","TypographyText","_ref15","_ref5","_ref11","SAdditionalLabel","_ref16","_ref6","_ref12","SCount","createComponent","exports"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import React, { DOMAttributes } from 'react';\nimport createComponent, { Component, sstyled, Root, IRootComponentProps } from '@semcore/core';\nimport { Flex, Box } from '@semcore/flex-box';\nimport Checkbox from '@semcore/checkbox';\nimport { Text as TypographyText } from '@semcore/typography';\n\nimport style from './legend-item.shadow.css';\nimport {\n ShapeProps,\n LegendItemProps,\n LegendItemType,\n LegendItem,\n StaticShapes,\n} from './LegendItem.type';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\n\nclass LegendItemRoot extends Component<\n LegendItemProps & { resolveColor: ReturnType<typeof resolveColorEnhance> }\n> {\n static displayName = 'LegendItem';\n static style = style;\n\n static enhance = [resolveColorEnhance()];\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 getShapeProps(): ShapeProps & DOMAttributes<HTMLLabelElement> {\n const { checked, color, shape, label, id, size, onClick, resolveColor } = this.asProps;\n\n return {\n id,\n label,\n shape,\n checked,\n color: resolveColor(color),\n size,\n onKeyUp: (e: React.KeyboardEvent<HTMLLabelElement>) => {\n if (onClick && e.key === ' ') {\n onClick();\n }\n },\n };\n }\n\n getIconProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n };\n }\n\n getLabelProps(): Omit<LegendItem, 'color'> & IRootComponentProps {\n const { color, ...props } = this.asProps;\n\n return {\n ...props,\n children: props.label,\n };\n }\n\n getAdditionalLabelProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n };\n }\n\n getCountProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\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);\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled}>\n <Children />\n </SLegendItem>,\n );\n }\n}\n\nfunction Shape(props: IRootComponentProps & ShapeProps & DOMAttributes<HTMLLabelElement>) {\n const SPointShape = Root;\n const {\n styles,\n size,\n shape,\n checked,\n color,\n Children,\n children: hasChildren,\n onKeyUp,\n label,\n } = props;\n\n if (hasChildren) {\n return <Children />;\n }\n\n if (shape === 'Checkbox') {\n return (\n <Checkbox\n size={size}\n checked={checked}\n theme={checked ? color : undefined}\n onKeyUp={onKeyUp}\n aria-label={label}\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,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAGA,IAAAM,WAAA,GAAAN,OAAA;AAOA,IAAAO,oBAAA,GAAAL,sBAAA,CAAAF,OAAA;AAAkF,IAAAQ,SAAA;AAAA;AAAA,IAAAC,KAAA,+BAAAX,KAAA,CAAAY,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAAA,IAE5EC,cAAc,0BAAAC,UAAA;EAAA,IAAAC,UAAA,aAAAF,cAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,OAAAC,aAAA,aAAAJ,cAAA;EAAA,SAAAA,eAAA;IAAA,IAAAK,gBAAA,mBAAAL,cAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAA,IAAAC,aAAA,aAAAR,cAAA;IAAAS,GAAA;IAAAC,KAAA,EAoBlB,SAAAC,cAAA,EAA8D;MAC5D,IAAAC,aAAA,GAA0E,IAAI,CAACC,OAAO;QAA9EC,OAAO,GAAAF,aAAA,CAAPE,OAAO;QAAEC,KAAK,GAAAH,aAAA,CAALG,KAAK;QAAEC,KAAK,GAAAJ,aAAA,CAALI,KAAK;QAAEC,KAAK,GAAAL,aAAA,CAALK,KAAK;QAAEC,EAAE,GAAAN,aAAA,CAAFM,EAAE;QAAEC,IAAI,GAAAP,aAAA,CAAJO,IAAI;QAAEC,OAAO,GAA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ekB,QAAQ,GAAAsC,MAAA,CAARtC,QAAQ;EACtD,IAAMyC,MAAM,GAOMR,gBAAc;EALhC,IAAI,CAACX,WAAW,EAAE;IAChB,OAAO,IAAI;EACb;EAEA,OAAAkB,MAAA,GAAO,IAAAvF,aAAO,EAAC8C,MAAM,CAAC,eACpBvD,MAAA,YAAA4D,aAAA,CAACqC,MAAM,EAAAD,MAAA,CAAAnC,EAAA,eAAAxB,cAAA,qBAAAxC,KAAA,CAAAiE,WAAA;IAAA,OAA8B;EAAW,GAAAiC,KAAA,kBAC9C/F,MAAA,YAAA4D,aAAA,CAACJ,QAAQ,EAAAwC,MAAA,CAAAnC,EAAA,iBAAG,CACL;AAEb;AACAW,KAAK,CAACY,WAAW,GAAG,OAAO;AAEpB,IAAMjB,mBAAmC,GAAG,IAAA+B,gBAAe,EAACvF,cAAc,EAAE;EACjFyD,KAAK,EAALA,KAAK;EACLC,IAAI,EAAJA,IAAI;EACJC,KAAK,EAALA,KAAK;EACLC,eAAe,EAAfA,eAAe;EACfC,KAAK,EAALA;AACF,CAAC,CAAC;AAAC2B,OAAA,CAAAhC,mBAAA,GAAAA,mBAAA"}
|
1
|
+
{"version":3,"file":"LegendItem.js","names":["_core","_interopRequireWildcard","require","_react","_interopRequireDefault","_flexBox","_checkbox","_typography","_LegendItem","_resolveColorEnhance","_Pattern","_utils","_excluded","style","sstyled","insert","LegendItemRoot","_Component","_inherits2","_super","_createSuper2","_classCallCheck2","apply","arguments","_createClass2","key","value","getShapeProps","_this$asProps","asProps","checked","color","shape","label","id","size","onClick","resolveColor","patterns","patternKey","onKeyUp","e","getIconProps","props","_objectSpread2","children","icon","getLabelProps","_this$asProps2","_objectWithoutProperties2","getAdditionalLabelProps","additionalInfo","concat","undefined","getCountProps","count","render","_ref","_ref7","SLegendItem","Flex","_this$asProps3","styles","Children","disabled","StaticShapes","includes","createElement","cn","assignProps","Component","_defineProperty2","resolveColorEnhance","Fragment","LegendItemComponent","Shape","Icon","Label","AdditionalLabel","Count","_ref2","arguments[0]","_ref10","SPointShape","Box","SPatternSymbol","PatternSymbol","_props$patternKey","getChartDefaultColorName","hasChildren","_ref8","_ref9","_ref15","_ref3","_ref11","SIcon","displayName","_ref16","_ref4","_ref12","SLabel","TypographyText","_ref17","_ref5","_ref13","SAdditionalLabel","_ref18","_ref6","_ref14","SCount","createComponent","exports"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.tsx"],"sourcesContent":["import React, { DOMAttributes } from 'react';\nimport createComponent, { Component, sstyled, Root, IRootComponentProps } from '@semcore/core';\nimport { Flex, Box } from '@semcore/flex-box';\nimport Checkbox from '@semcore/checkbox';\nimport { Text as TypographyText } from '@semcore/typography';\n\nimport style from './legend-item.shadow.css';\nimport {\n ShapeProps,\n LegendItemProps,\n LegendItemType,\n LegendItem,\n StaticShapes,\n} from './LegendItem.type';\nimport resolveColorEnhance from '@semcore/utils/lib/enhances/resolveColorEnhance';\nimport { PatternSymbol } from '../../../Pattern';\nimport { getChartDefaultColorName } from '../../../utils';\n\nclass LegendItemRoot extends Component<\n LegendItemProps & { resolveColor: ReturnType<typeof resolveColorEnhance> }\n> {\n static displayName = 'LegendItem';\n static style = style;\n\n static enhance = [resolveColorEnhance()];\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 getShapeProps(): ShapeProps & DOMAttributes<HTMLLabelElement> {\n const { checked, color, shape, label, id, size, onClick, resolveColor, patterns } =\n this.asProps;\n\n return {\n id,\n label,\n shape,\n checked,\n color: resolveColor(color),\n patternKey: color,\n patterns,\n size,\n onKeyUp: (e: React.KeyboardEvent<HTMLLabelElement>) => {\n if (onClick && e.key === ' ') {\n onClick();\n }\n },\n };\n }\n\n getIconProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n return {\n ...props,\n children: props.icon,\n };\n }\n\n getLabelProps(): Omit<LegendItem, 'color'> & IRootComponentProps {\n const { color, ...props } = this.asProps;\n\n return {\n ...props,\n children: props.label,\n };\n }\n\n getAdditionalLabelProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children: additionalInfo && 'label' in additionalInfo ? `${additionalInfo.label}` : undefined,\n };\n }\n\n getCountProps(): LegendItem & IRootComponentProps {\n const props = this.asProps;\n\n const { additionalInfo } = props;\n\n return {\n ...props,\n children:\n additionalInfo && 'count' in additionalInfo ? `(${additionalInfo.count})` : undefined,\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);\n\n return sstyled(styles)(\n <SLegendItem render={Flex} disabled={disabled}>\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 onKeyUp,\n label,\n patterns,\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} />\n </Box>,\n );\n }\n\n if (shape === 'Checkbox') {\n return sstyled(styles)(\n <>\n <Checkbox\n size={size}\n checked={checked}\n theme={checked ? color : undefined}\n onKeyUp={onKeyUp}\n aria-label={label}\n />\n {patterns && (\n <Box mt={'2px'} mr={1}>\n <SPatternSymbol color={color} patternKey={patternKey} />\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,uBAAA,CAAAC,OAAA;AADA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAGA,IAAAM,WAAA,GAAAN,OAAA;AAOA,IAAAO,oBAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AAA0D,IAAAU,SAAA;AAAA;AAAA,IAAAC,KAAA,+BAAAb,KAAA,CAAAc,OAAA,CAAAC,MAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA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art data item
|
9
9
|
*/
|
10
10
|
|
11
|
-
var StaticShapes = ['Circle', 'Line', 'Square'];
|
11
|
+
var StaticShapes = ['Circle', 'Line', 'Square', 'Pattern'];
|
12
12
|
exports.StaticShapes = StaticShapes;
|
13
13
|
//# sourceMappingURL=LegendItem.type.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"LegendItem.type.js","names":["StaticShapes","exports"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.type.ts"],"sourcesContent":["import { Flex } from '@semcore/flex-box';\nimport { Intergalactic, Root } from '@semcore/core';\nimport Icon from '@semcore/icon';\nimport { Text } from '@semcore/typography';\nimport { 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\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 */\n onClick: () => void;\n};\n\nexport type ShapeProps = LegendItem & {\n size: LSize;\n shape: ShapeType;\n};\n\nexport const StaticShapes = ['Circle', 'Line', 'Square'] 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":";;;;;;
|
1
|
+
{"version":3,"file":"LegendItem.type.js","names":["StaticShapes","exports"],"sources":["../../../../../src/component/ChartLegend/LegendItem/LegendItem.type.ts"],"sourcesContent":["import { Flex } from '@semcore/flex-box';\nimport { Intergalactic, Root } from '@semcore/core';\nimport Icon from '@semcore/icon';\nimport { Text } from '@semcore/typography';\nimport { LSize } from '../BaseLegend.type';\nimport { PatternsConfig } from '../../../Pattern';\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 accessability */\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 */\n onClick: () => void;\n\n /** Enables patterns symbols that enhances charts accessability */\n patterns?: PatternsConfig;\n};\n\nexport type ShapeProps = LegendItem & {\n size: LSize;\n shape: ShapeType;\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":";;;;;;AAOA;AACA;AACA;;AA2DO,IAAMA,YAAY,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAU;AAACC,OAAA,CAAAD,YAAA,GAAAA,YAAA"}
|
@@ -59,6 +59,11 @@ SPointShape[shape='Square'][size='m'] {
|
|
59
59
|
margin-top: 4px;
|
60
60
|
}
|
61
61
|
|
62
|
+
SPointShape[shape='Pattern'] {
|
63
|
+
background-color: transparent;
|
64
|
+
margin-right: 4px;
|
65
|
+
}
|
66
|
+
|
62
67
|
SIcon {
|
63
68
|
line-height: 0;
|
64
69
|
margin-right: 4px;
|
@@ -76,17 +81,22 @@ SLabel {
|
|
76
81
|
min-width: 0;
|
77
82
|
}
|
78
83
|
|
79
|
-
SLabel[size='l'],
|
84
|
+
SLabel[size='l'],
|
85
|
+
SAdditionalLabel[size='l'],
|
86
|
+
SCount[size='l'] {
|
80
87
|
font-size: var(--intergalactic-fs-300, 16px);
|
81
88
|
line-height: var(--intergalactic-lh-300, 150%);
|
82
89
|
}
|
83
90
|
|
84
|
-
SLabel[size='m'],
|
91
|
+
SLabel[size='m'],
|
92
|
+
SAdditionalLabel[size='m'],
|
93
|
+
SCount[size='m'] {
|
85
94
|
font-size: var(--intergalactic-fs-200, 14px);
|
86
95
|
line-height: var(--intergalactic-lh-200, 142%);
|
87
96
|
}
|
88
97
|
|
89
|
-
SAdditionalLabel,
|
98
|
+
SAdditionalLabel,
|
99
|
+
SCount {
|
90
100
|
margin-left: 4px;
|
91
101
|
}
|
92
102
|
|
@@ -113,3 +123,7 @@ SAdditionalLabel[size='l']::before {
|
|
113
123
|
SAdditionalLabel[size='m']::before {
|
114
124
|
margin-top: 8px;
|
115
125
|
}
|
126
|
+
|
127
|
+
SPatternSymbol {
|
128
|
+
transform: scale(0.8);
|
129
|
+
}
|
@@ -18,12 +18,12 @@ var _flexBox = require("intergalactic/flex-box");
|
|
18
18
|
var _LegendItem = require("../LegendItem/LegendItem");
|
19
19
|
var _BaseLegend2 = require("../BaseLegend");
|
20
20
|
/*__reshadow-styles__:"./legend-table.shadow.css"*/
|
21
|
-
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".
|
22
|
-
"__SLegendTable": "
|
23
|
-
"_columns-count": "__columns-
|
24
|
-
"__SColumnItem": "
|
25
|
-
"_size_l": "
|
26
|
-
"_size_m": "
|
21
|
+
var style = ( /*__reshadow_css_start__*/_core.sstyled.insert( /*__inner_css_start__*/".___SLegendTable_5x0ni_gg_.__columns-count_5x0ni_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_5x0ni_gg_._size_l_5x0ni_gg_{font-size:var(--intergalactic-fs-300, 16px);text-align:right}.___SColumnItem_5x0ni_gg_._size_m_5x0ni_gg_{font-size:var(--intergalactic-fs-200, 14px);text-align:right}" /*__inner_css_end__*/, "5x0ni_gg_") /*__reshadow_css_end__*/, {
|
22
|
+
"__SLegendTable": "___SLegendTable_5x0ni_gg_",
|
23
|
+
"_columns-count": "__columns-count_5x0ni_gg_",
|
24
|
+
"__SColumnItem": "___SColumnItem_5x0ni_gg_",
|
25
|
+
"_size_l": "_size_l_5x0ni_gg_",
|
26
|
+
"_size_m": "_size_m_5x0ni_gg_"
|
27
27
|
});
|
28
28
|
var LegendTableRoot = /*#__PURE__*/function (_BaseLegend) {
|
29
29
|
(0, _inherits2["default"])(LegendTableRoot, _BaseLegend);
|
@@ -77,6 +77,18 @@ Object.defineProperty(exports, "Line", {
|
|
77
77
|
return _Line["default"];
|
78
78
|
}
|
79
79
|
});
|
80
|
+
Object.defineProperty(exports, "PatternFill", {
|
81
|
+
enumerable: true,
|
82
|
+
get: function get() {
|
83
|
+
return _Pattern.PatternFill;
|
84
|
+
}
|
85
|
+
});
|
86
|
+
Object.defineProperty(exports, "PatternSymbol", {
|
87
|
+
enumerable: true,
|
88
|
+
get: function get() {
|
89
|
+
return _Pattern.PatternSymbol;
|
90
|
+
}
|
91
|
+
});
|
80
92
|
Object.defineProperty(exports, "Plot", {
|
81
93
|
enumerable: true,
|
82
94
|
get: function get() {
|
@@ -161,6 +173,12 @@ Object.defineProperty(exports, "getLabelOffsetPosition", {
|
|
161
173
|
return _Radar.getLabelOffsetPosition;
|
162
174
|
}
|
163
175
|
});
|
176
|
+
Object.defineProperty(exports, "getPatternSymbolSize", {
|
177
|
+
enumerable: true,
|
178
|
+
get: function get() {
|
179
|
+
return _Pattern.getPatternSymbolSize;
|
180
|
+
}
|
181
|
+
});
|
164
182
|
Object.defineProperty(exports, "interpolateValue", {
|
165
183
|
enumerable: true,
|
166
184
|
get: function get() {
|
@@ -203,4 +221,5 @@ var _Hover = require("./Hover");
|
|
203
221
|
var _utils = require("./utils");
|
204
222
|
var _color = require("./color");
|
205
223
|
var _hints = require("./a11y/hints");
|
224
|
+
var _Pattern = require("./Pattern");
|
206
225
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","names":["_Plot","_interopRequireDefault","require","_ChartLegend","_Chart","_Axis","_Line","_Bar","_HorizontalBar","_GroupBar","_StackBar","_Area","_StackedArea","_ScatterPlot","_Bubble","_RadialTree","_Donut","_Venn","_Radar","_interopRequireWildcard","_Tooltip","_ResponsiveContainer","_ReferenceLine","_Hover","_utils","_color","_hints"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport { minMax, interpolateValue } from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n"],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","names":["_Plot","_interopRequireDefault","require","_ChartLegend","_Chart","_Axis","_Line","_Bar","_HorizontalBar","_GroupBar","_StackBar","_Area","_StackedArea","_ScatterPlot","_Bubble","_RadialTree","_Donut","_Venn","_Radar","_interopRequireWildcard","_Tooltip","_ResponsiveContainer","_ReferenceLine","_Hover","_utils","_color","_hints","_Pattern"],"sources":["../../src/index.js"],"sourcesContent":["export { default as Plot } from './Plot';\nexport { ChartLegend, ChartLegendTable } from './component/ChartLegend';\nexport { default as Chart } from './component/Chart';\nexport { XAxis, YAxis } from './Axis';\n\nexport { default as Line } from './Line';\n\nexport { default as Bar } from './Bar';\nexport { default as HorizontalBar } from './HorizontalBar';\nexport { default as GroupBar } from './GroupBar';\nexport { default as StackBar } from './StackBar';\nexport { default as Area } from './Area';\nexport { default as StackedArea } from './StackedArea';\nexport { default as ScatterPlot } from './ScatterPlot';\nexport { default as Bubble } from './Bubble';\nexport { default as RadialTree } from './RadialTree';\nexport { default as Donut } from './Donut';\nexport { default as Venn } from './Venn';\nexport { default as Radar, getLabelOffsetPosition } from './Radar';\n\nexport { default as Tooltip } from './Tooltip';\n\nexport { default as ResponsiveContainer } from './ResponsiveContainer';\nexport { default as ReferenceLine } from './ReferenceLine';\n\nexport { HoverLine, HoverRect } from './Hover';\n\nexport { minMax, interpolateValue } from './utils';\nexport { colors } from './color';\n\nexport { makeDataHintsContainer } from './a11y/hints';\n\nexport { PatternFill, PatternSymbol, getPatternSymbolSize } from './Pattern';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AAEA,IAAAK,IAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,cAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,SAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,SAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,KAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,YAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,YAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,OAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,WAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,MAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,KAAA,GAAAhB,sBAAA,CAAAC,OAAA;AACA,IAAAgB,MAAA,GAAAC,uBAAA,CAAAjB,OAAA;AAEA,IAAAkB,QAAA,GAAAnB,sBAAA,CAAAC,OAAA;AAEA,IAAAmB,oBAAA,GAAApB,sBAAA,CAAAC,OAAA;AACA,IAAAoB,cAAA,GAAArB,sBAAA,CAAAC,OAAA;AAEA,IAAAqB,MAAA,GAAArB,OAAA;AAEA,IAAAsB,MAAA,GAAAtB,OAAA;AACA,IAAAuB,MAAA,GAAAvB,OAAA;AAEA,IAAAwB,MAAA,GAAAxB,OAAA;AAEA,IAAAyB,QAAA,GAAAzB,OAAA"}
|
@@ -11,6 +11,12 @@ SBar[color] {
|
|
11
11
|
fill: var(--color);
|
12
12
|
}
|
13
13
|
|
14
|
+
SBar[pattern][color] {
|
15
|
+
fill: var(--pattern);
|
16
|
+
stroke: var(--color);
|
17
|
+
stroke-width: 1px;
|
18
|
+
}
|
19
|
+
|
14
20
|
SBar[hide] {
|
15
21
|
display: none;
|
16
22
|
}
|
@@ -21,4 +27,4 @@ SBar[transparent] {
|
|
21
27
|
|
22
28
|
SBackground {
|
23
29
|
fill: var(--intergalactic-chart-palette-order-other-data, #c4c7cf);
|
24
|
-
}
|
30
|
+
}
|
@@ -8,6 +8,7 @@ SBubble {
|
|
8
8
|
transition-duration: var(--duration);
|
9
9
|
transition-timing-function: ease-in-out;
|
10
10
|
opacity: 0.5;
|
11
|
+
|
11
12
|
&:hover {
|
12
13
|
opacity: 0.8;
|
13
14
|
}
|
@@ -17,6 +18,12 @@ SBubble[color] {
|
|
17
18
|
fill: var(--color);
|
18
19
|
}
|
19
20
|
|
21
|
+
SBubble[pattern][color] {
|
22
|
+
fill: var(--pattern);
|
23
|
+
stroke: var(--color);
|
24
|
+
stroke-width: 1px;
|
25
|
+
}
|
26
|
+
|
20
27
|
SBubble[transparent] {
|
21
28
|
opacity: 0.3;
|
22
29
|
}
|
@@ -54,4 +61,4 @@ SLabel[color] {
|
|
54
61
|
|
55
62
|
SLabel[transparent] {
|
56
63
|
opacity: 0.3;
|
57
|
-
}
|
64
|
+
}
|