@fluentui/react-charts 9.3.27 → 9.3.29
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 +32 -2
- package/dist/index.d.cts +51 -0
- package/dist/index.d.ts +51 -0
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +1 -4
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/index.js.map +1 -1
- package/lib/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.js +35 -5
- package/lib/components/AreaChart/AreaChart.js.map +1 -1
- package/lib/components/AreaChart/AreaChart.types.js.map +1 -1
- package/lib/components/AreaChart/index.js.map +1 -1
- package/lib/components/AreaChart/useAreaChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.js.map +1 -1
- package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
- package/lib/components/ChartTable/index.js.map +1 -1
- package/lib/components/ChartTable/useChartTableStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +19 -29
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.types.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/index.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +2 -2
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +2 -2
- package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.js +17 -15
- package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
- package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.js +3 -2
- package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
- package/lib/components/CommonComponents/ChartPopover.types.js.map +1 -1
- package/lib/components/CommonComponents/index.js.map +1 -1
- package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
- package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
- package/lib/components/DeclarativeChart/DeclarativeChart.js +9 -9
- package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js +4 -4
- package/lib/components/DeclarativeChart/PlotlyColorAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +92 -110
- package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
- package/lib/components/DeclarativeChart/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.js.map +1 -1
- package/lib/components/DonutChart/Arc/Arc.types.js.map +1 -1
- package/lib/components/DonutChart/Arc/index.js.map +1 -1
- package/lib/components/DonutChart/Arc/useArcStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.js.map +1 -1
- package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
- package/lib/components/DonutChart/Pie/Pie.types.js.map +1 -1
- package/lib/components/DonutChart/Pie/index.js.map +1 -1
- package/lib/components/DonutChart/Pie/usePieStyles.styles.raw.js.map +1 -1
- package/lib/components/DonutChart/index.js.map +1 -1
- package/lib/components/DonutChart/useDonutChartStyles.styles.raw.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.js +5 -5
- package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
- package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
- package/lib/components/FunnelChart/funnelGeometry.js.map +1 -1
- package/lib/components/FunnelChart/index.js.map +1 -1
- package/lib/components/FunnelChart/useFunnelChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.js +4 -3
- package/lib/components/GanttChart/GanttChart.js.map +1 -1
- package/lib/components/GanttChart/GanttChart.types.js.map +1 -1
- package/lib/components/GanttChart/index.js.map +1 -1
- package/lib/components/GanttChart/useGanttChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.js +34 -13
- package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
- package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
- package/lib/components/GaugeChart/index.js.map +1 -1
- package/lib/components/GaugeChart/useGaugeChartStyles.styles.raw.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +45 -46
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/index.js.map +1 -1
- package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.js +1 -0
- package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
- package/lib/components/HeatMapChart/HeatMapChart.types.js.map +1 -1
- package/lib/components/HeatMapChart/index.js.map +1 -1
- package/lib/components/HeatMapChart/useHeatMapChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js +5 -6
- package/lib/components/HorizontalBarChart/HorizontalBarChart.js.map +1 -1
- package/lib/components/HorizontalBarChart/HorizontalBarChart.types.js.map +1 -1
- package/lib/components/HorizontalBarChart/index.js.map +1 -1
- package/lib/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -4
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/index.js.map +1 -1
- package/lib/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.js.map +1 -1
- package/lib/components/Legends/Legends.js +16 -20
- package/lib/components/Legends/Legends.js.map +1 -1
- package/lib/components/Legends/Legends.types.js.map +1 -1
- package/lib/components/Legends/OverflowMenu.js +13 -10
- package/lib/components/Legends/OverflowMenu.js.map +1 -1
- package/lib/components/Legends/index.js.map +1 -1
- package/lib/components/Legends/shape.js.map +1 -1
- package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
- package/lib/components/LineChart/LineChart.js +40 -36
- package/lib/components/LineChart/LineChart.js.map +1 -1
- package/lib/components/LineChart/LineChart.types.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/LabelLink.js.map +1 -1
- package/lib/components/LineChart/eventAnnotation/Textbox.js.map +1 -1
- package/lib/components/LineChart/index.js.map +1 -1
- package/lib/components/LineChart/useLineChartStyles.styles.raw.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.js +3 -4
- package/lib/components/PolarChart/PolarChart.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.types.js.map +1 -1
- package/lib/components/PolarChart/PolarChart.utils.js +3 -3
- package/lib/components/PolarChart/PolarChart.utils.js.map +1 -1
- package/lib/components/PolarChart/index.js.map +1 -1
- package/lib/components/PolarChart/usePolarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.js.map +1 -1
- package/lib/components/ResponsiveContainer/ResponsiveContainer.types.js.map +1 -1
- package/lib/components/ResponsiveContainer/index.js.map +1 -1
- package/lib/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.js.map +1 -1
- package/lib/components/ResponsiveContainer/withResponsiveContainer.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
- package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
- package/lib/components/SankeyChart/index.js.map +1 -1
- package/lib/components/SankeyChart/useSankeyChartStyles.styles.raw.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.js +3 -3
- package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
- package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
- package/lib/components/ScatterChart/index.js.map +1 -1
- package/lib/components/ScatterChart/useScatterChartStyles.styles.raw.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.js +1 -3
- package/lib/components/Sparkline/Sparkline.js.map +1 -1
- package/lib/components/Sparkline/Sparkline.types.js.map +1 -1
- package/lib/components/Sparkline/index.js.map +1 -1
- package/lib/components/Sparkline/useSparklineStyles.styles.raw.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChart.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js +2 -2
- package/lib/components/VegaDeclarativeChart/VegaLiteColorAdapter.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js +1 -0
- package/lib/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js +88 -88
- package/lib/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/VegaLiteTypes.js.map +1 -1
- package/lib/components/VegaDeclarativeChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js +2 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
- package/lib/components/VerticalBarChart/VerticalBarChart.types.js.map +1 -1
- package/lib/components/VerticalBarChart/index.js.map +1 -1
- package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +6 -5
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.types.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/index.js.map +1 -1
- package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.js.map +1 -1
- package/lib/types/ChartAnnotation.js.map +1 -1
- package/lib/types/DataPoint.js.map +1 -1
- package/lib/types/EventAnnotation.js.map +1 -1
- package/lib/types/LegendDataItem.js.map +1 -1
- package/lib/types/index.js.map +1 -1
- package/lib/utilities/ChartTitle.js +3 -4
- package/lib/utilities/ChartTitle.js.map +1 -1
- package/lib/utilities/Common.styles.js +1 -4
- package/lib/utilities/Common.styles.js.map +1 -1
- package/lib/utilities/Common.styles.raw.js +1 -4
- package/lib/utilities/Common.styles.raw.js.map +1 -1
- package/lib/utilities/FocusableTooltipText.js.map +1 -1
- package/lib/utilities/KeyCodes.js.map +1 -1
- package/lib/utilities/SVGTooltipText.js.map +1 -1
- package/lib/utilities/async-utils.js.map +1 -1
- package/lib/utilities/colors.js.map +1 -1
- package/lib/utilities/getWindow.js.map +1 -1
- package/lib/utilities/hooks.js.map +1 -1
- package/lib/utilities/image-export-utils.js.map +1 -1
- package/lib/utilities/index.js.map +1 -1
- package/lib/utilities/overflow-utils.js.map +1 -1
- package/lib/utilities/scatterpolar-utils.js +3 -4
- package/lib/utilities/scatterpolar-utils.js.map +1 -1
- package/lib/utilities/string.js.map +1 -1
- package/lib/utilities/test-data/specialChartNames.js +11 -0
- package/lib/utilities/test-data/specialChartNames.js.map +1 -0
- package/lib/utilities/test-data.js.map +1 -1
- package/lib/utilities/utilities.js +9 -9
- package/lib/utilities/utilities.js.map +1 -1
- package/lib/utilities/vbc-utils.js.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.cjs +1 -4
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/index.cjs.map +1 -1
- package/lib-commonjs/components/AnnotationOnlyChart/useAnnotationOnlyChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.cjs +35 -5
- package/lib-commonjs/components/AreaChart/AreaChart.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/AreaChart.types.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/index.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/ChartTable.types.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/index.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ChartTable/useChartTableStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.cjs +19 -29
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/index.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.cjs +14 -14
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.cjs +14 -14
- package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.cjs +17 -15
- package/lib-commonjs/components/CommonComponents/CartesianChart.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/CartesianChart.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.cjs +3 -2
- package/lib-commonjs/components/CommonComponents/ChartPopover.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/ChartPopover.types.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/index.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs +9 -9
- package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.cjs +13 -13
- package/lib-commonjs/components/DeclarativeChart/PlotlyColorAdapter.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs +122 -140
- package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/DeclarativeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/Arc.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Arc/useArcStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/DonutChart.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/Pie.types.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/Pie/usePieStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/index.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/DonutChart/useDonutChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs +5 -5
- package/lib-commonjs/components/FunnelChart/FunnelChart.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/FunnelChart.types.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/funnelGeometry.cjs +6 -6
- package/lib-commonjs/components/FunnelChart/funnelGeometry.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/index.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/FunnelChart/useFunnelChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.cjs +4 -3
- package/lib-commonjs/components/GanttChart/GanttChart.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/GanttChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GanttChart/useGanttChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs +41 -20
- package/lib-commonjs/components/GaugeChart/GaugeChart.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/GaugeChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GaugeChart/useGaugeChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs +44 -44
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs +1 -0
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/HeatMapChart.types.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/index.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HeatMapChart/useHeatMapChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.cjs +5 -6
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/HorizontalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChart/useHorizontalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs +4 -4
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.types.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/index.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/HorizontalBarChartWithAxis/useHorizontalBarChartWithAxisStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Legends/Legends.cjs +16 -19
- package/lib-commonjs/components/Legends/Legends.cjs.map +1 -1
- package/lib-commonjs/components/Legends/Legends.types.cjs.map +1 -1
- package/lib-commonjs/components/Legends/OverflowMenu.cjs +12 -9
- package/lib-commonjs/components/Legends/OverflowMenu.cjs.map +1 -1
- package/lib-commonjs/components/Legends/index.cjs.map +1 -1
- package/lib-commonjs/components/Legends/shape.cjs.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.cjs +11 -11
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.cjs +11 -11
- package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.cjs +40 -36
- package/lib-commonjs/components/LineChart/LineChart.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/LineChart.types.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/LabelLink.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/eventAnnotation/Textbox.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/index.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/LineChart/useLineChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.cjs +3 -4
- package/lib-commonjs/components/PolarChart/PolarChart.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/PolarChart.utils.cjs +10 -10
- package/lib-commonjs/components/PolarChart/PolarChart.utils.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/PolarChart/usePolarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.cjs +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/ResponsiveContainer.types.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/index.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ResponsiveContainer/useResponsiveChildStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ResponsiveContainer/withResponsiveContainer.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs +5 -5
- package/lib-commonjs/components/SankeyChart/SankeyChart.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/SankeyChart.types.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/index.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/ScatterChart.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/ScatterChart.types.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/index.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.cjs +1 -3
- package/lib-commonjs/components/Sparkline/Sparkline.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/Sparkline.types.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/index.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.cjs +3 -3
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/Sparkline/useSparklineStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChart.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.cjs +3 -3
- package/lib-commonjs/components/VegaDeclarativeChart/VegaDeclarativeChartHooks.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.cjs +7 -7
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteColorAdapter.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs +1 -0
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteExpressionEvaluator.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs +105 -105
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteSchemaAdapter.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/VegaLiteTypes.cjs.map +1 -1
- package/lib-commonjs/components/VegaDeclarativeChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs +2 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs +6 -5
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.types.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/index.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.cjs +3 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.cjs.map +1 -1
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.cjs +3 -3
- package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.raw.cjs.map +1 -1
- package/lib-commonjs/types/ChartAnnotation.cjs.map +1 -1
- package/lib-commonjs/types/DataPoint.cjs.map +1 -1
- package/lib-commonjs/types/EventAnnotation.cjs.map +1 -1
- package/lib-commonjs/types/LegendDataItem.cjs.map +1 -1
- package/lib-commonjs/types/index.cjs.map +1 -1
- package/lib-commonjs/utilities/ChartTitle.cjs +3 -4
- package/lib-commonjs/utilities/ChartTitle.cjs.map +1 -1
- package/lib-commonjs/utilities/Common.styles.cjs +9 -12
- package/lib-commonjs/utilities/Common.styles.cjs.map +1 -1
- package/lib-commonjs/utilities/Common.styles.raw.cjs +9 -12
- package/lib-commonjs/utilities/Common.styles.raw.cjs.map +1 -1
- package/lib-commonjs/utilities/FocusableTooltipText.cjs.map +1 -1
- package/lib-commonjs/utilities/KeyCodes.cjs.map +1 -1
- package/lib-commonjs/utilities/SVGTooltipText.cjs.map +1 -1
- package/lib-commonjs/utilities/async-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/colors.cjs +7 -7
- package/lib-commonjs/utilities/colors.cjs.map +1 -1
- package/lib-commonjs/utilities/getWindow.cjs.map +1 -1
- package/lib-commonjs/utilities/hooks.cjs.map +1 -1
- package/lib-commonjs/utilities/image-export-utils.cjs +3 -3
- package/lib-commonjs/utilities/image-export-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/index.cjs.map +1 -1
- package/lib-commonjs/utilities/overflow-utils.cjs +4 -4
- package/lib-commonjs/utilities/overflow-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/scatterpolar-utils.cjs +6 -7
- package/lib-commonjs/utilities/scatterpolar-utils.cjs.map +1 -1
- package/lib-commonjs/utilities/string.cjs +1 -1
- package/lib-commonjs/utilities/string.cjs.map +1 -1
- package/lib-commonjs/utilities/test-data/specialChartNames.cjs +21 -0
- package/lib-commonjs/utilities/test-data/specialChartNames.cjs.map +1 -0
- package/lib-commonjs/utilities/test-data.cjs +18 -18
- package/lib-commonjs/utilities/test-data.cjs.map +1 -1
- package/lib-commonjs/utilities/utilities.cjs +92 -92
- package/lib-commonjs/utilities/utilities.cjs.map +1 -1
- package/lib-commonjs/utilities/vbc-utils.cjs +7 -7
- package/lib-commonjs/utilities/vbc-utils.cjs.map +1 -1
- package/package.json +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Legends/Legends.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport { Button } from '@fluentui/react-button';\nimport type { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\nimport { cloneLegendsToSVG } from '../../utilities/image-export-utils';\nimport { mergeClasses } from '@griffel/react';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n legendAnnotation?: () => React.ReactNode;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>({});\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n const classes = useLegendStyles(props);\n const toSVG = React.useCallback(\n (svgWidth: number, isRTL: boolean = false) => {\n return cloneLegendsToSVG(\n props.legends,\n svgWidth,\n {\n selectedLegends,\n centerLegends: !!props.centerLegends,\n textClassName: classes.text!,\n isRTL,\n },\n _rootElem.current,\n );\n },\n [props.legends, props.centerLegends, selectedLegends, classes.text],\n );\n\n React.useImperativeHandle(props.legendRef, () => ({\n toSVG,\n }));\n\n React.useEffect(() => {\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n let selectedLegendsState = {};\n if (props.canSelectMultipleLegends) {\n selectedLegendsState =\n (initialSelectedLegends ?? [])?.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (combineDict: any, key: any) => ({ [key]: true, ...combineDict }),\n {},\n ) || {};\n setSelectedLegends(selectedLegendsState);\n } else if (initialSelectedLegend !== undefined) {\n selectedLegendsState = { [initialSelectedLegend]: true };\n setSelectedLegends(selectedLegendsState);\n }\n }, [\n props.canSelectMultipleLegends,\n props.defaultSelectedLegend,\n props.defaultSelectedLegends,\n props.selectedLegend,\n props.selectedLegends,\n ]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSXElement[] = [];\n dataToRender.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index, true);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSXElement {\n return (\n <div {...focusAttributes} {...arrowAttributes} className={classes.root} ref={_rootElem}>\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {/*\n Only the selectable options belong to the listbox; the overflow trigger stays a sibling so a\n menu button is not treated as a listbox child. `display: contents` keeps the options as direct\n flex participants so overflow measurement is unaffected.\n */}\n <div\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ display: 'contents' }}\n >\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item, id)}\n </OverflowItem>\n ))}\n </div>\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSXElement {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n ref={_rootElem}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map((item, id) => (\n <div\n className={mergeClasses(classes.legendContainer, item.legendAnnotation && classes.annotation)}\n key={item.key}\n >\n {_renderButton(item, id)}\n {item.legendAnnotation && <div>{item.legendAnnotation()}</div>}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n legendAnnotation: legend.legendAnnotation,\n };\n });\n return dataItems;\n }\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n function _isInControlledMode(): boolean {\n return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n function _getNewSelectedLegendsForMultiselect(legend: Legend): { [key: string]: boolean } {\n let legendsSelected = { ...selectedLegends };\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = {};\n }\n }\n return legendsSelected;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n function _getNewSelectedLegendsForSingleSelect(legend: Legend): { [key: string]: boolean } {\n return selectedLegends[legend.title] ? {} : { [legend.title]: true };\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? _getNewSelectedLegendsForMultiselect(legend)\n : _getNewSelectedLegendsForSingleSelect(legend);\n\n if (!_isInControlledMode()) {\n setSelectedLegends(nextSelectedLegends);\n }\n props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number, isOverflowItem?: boolean) {\n const { allowFocusOnLegends = true } = props;\n // Overflow legends are rendered inside a menu, not the listbox, so they must not carry `option` semantics.\n const showListboxOption = allowFocusOnLegends && !isOverflowItem;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLElement>) => {\n _onClick(legend, event as React.MouseEvent<HTMLButtonElement>);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n const legendStyle = {\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n } as React.CSSProperties;\n const legendContent = (\n <>\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </>\n );\n // Shared by the listbox Button and the overflow div. Hover/focus handlers are included so the overflow\n // menu can forward them to its item (the div itself never receives focus).\n const commonProps: React.HTMLAttributes<HTMLElement> = {\n className: classes.legend,\n onClick: onClickHandler,\n onMouseOver: onHoverHandler,\n onMouseOut: onMouseOut,\n onFocus: onHoverHandler,\n onBlur: onMouseOut,\n style: legendStyle,\n };\n if (isOverflowItem) {\n // In the overflow menu the item itself is interactive, so keep this content a non-interactive div to\n // avoid nested clickable elements. display:flex lays the swatch and label out inline (a bare div would\n // stack them). data-selected / data-title are read by the overflow menu to drive its checked state.\n return (\n <div\n key={index}\n {...commonProps}\n data-selected={!!selectedLegends[legend.title]}\n data-title={legend.title}\n style={{ ...legendStyle, display: 'flex', alignItems: 'center' }}\n >\n {legendContent}\n </div>\n );\n }\n return (\n <Button\n {...(showListboxOption && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n // Full-list position so counts match the overflow menu.\n 'aria-setsize': props.legends.length,\n 'aria-posinset': (index ?? 0) + 1,\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n {...commonProps}\n appearance={'outline'}\n size=\"small\"\n >\n {legendContent}\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","cloneLegendsToSVG","mergeClasses","Legends","forwardRef","props","forwardedRef","_isLegendSelected","_rootElem","useRef","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","focusAttributes","arrowAttributes","axis","memorizeCurrent","classes","toSVG","useCallback","svgWidth","isRTL","legends","centerLegends","textClassName","text","current","useImperativeHandle","legendRef","useEffect","initialSelectedLegends","defaultSelectedLegends","initialSelectedLegend","selectedLegend","defaultSelectedLegend","selectedLegendsState","canSelectMultipleLegends","reduce","combineDict","key","undefined","Object","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","itemIds","map","_item","index","toString","overflowHoverCardLegends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","className","root","ref","resizableArea","style","textAlign","role","display","item","id","title","items","justifyContent","flexWrap","overflow","legendContainer","legendAnnotation","annotation","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_isInControlledMode","_getNewSelectedLegendsForMultiselect","legendsSelected","_getNewSelectedLegendsForSingleSelect","_onClick","event","nextSelectedLegends","onChange","_onHoverOverLegend","_onLeave","data","isOverflowItem","showListboxOption","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","legendStyle","colorNeutralStroke1","legendContent","colorNeutralBackground1","commonProps","onClick","onMouseOver","onFocus","onBlur","data-selected","data-title","alignItems","nativeButtonProps","appearance","size","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"mappings":"AAAA;;;;;+BAyCaY;;;;;;;iEAvCU,QAAQ;6BAGR,yBAAyB;uBAE1B,aAAU;wCACA,+BAA4B;+BACrB,2BAA2B;8BACP,0BAA0B;8BACxD,oBAAiB;4BACvB,wBAAwB;kCACb,wCAAqC;wBAC1C,iBAAiB;AA2BvC,gBAAMA,WAAAA,GAAiDZ,OAAMa,UAAU,CAC5E,CAACC,OAAOC;IACN,kEAAkE,GAClE,IAAIC,oBAAoB;IACxB,MAAMC,YAAYjB,OAAMkB,MAAM,CAAwB;IAEtD,2DAA2D;IAC3D,MAAM,CAACC,cAAcC,gBAAgB,GAAGpB,OAAMqB,QAAQ,CAAC;IACvD,MAAM,CAACC,iBAAiBC,mBAAmB,GAAGvB,OAAMqB,QAAQ,CAAY,CAAC;IACzE,MAAMG,sBAAkBlB,+BAAAA;IACxB,MAAMmB,sBAAkBlB,qCAAAA,EAAwB;QAAEmB,MAAM;QAAcC,iBAAiB;IAAK;IAC5F,MAAMC,cAAUzB,uCAAAA,EAAgBW;IAChC,MAAMe,QAAQ7B,OAAM8B,WAAW,CAC7B,CAACC,UAAkBC,QAAiB,KAAK;QACvC,WAAOtB,mCAAAA,EACLI,MAAMmB,OAAO,EACbF,UACA;YACET;YACAY,eAAe,CAAC,CAACpB,MAAMoB,aAAa;YACpCC,eAAeP,QAAQQ,IAAI;YAC3BJ;QACF,GACAf,UAAUoB,OAAO;IAErB,GACA;QAACvB,MAAMmB,OAAO;QAAEnB,MAAMoB,aAAa;QAAEZ;QAAiBM,QAAQQ,IAAI;KAAC;IAGrEpC,OAAMsC,mBAAmB,CAACxB,MAAMyB,SA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ACA;AACFxI,QAAQyI,WAAW,GAAG"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Legends/Legends.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\n\nimport { Button } from '@fluentui/react-button';\nimport type { Legend, LegendsProps, LegendShape } from './Legends.types';\nimport { Shape } from './shape';\nimport { useLegendStyles } from './useLegendsStyles.styles';\nimport { Overflow, OverflowItem } from '@fluentui/react-overflow';\nimport { useFocusableGroup, useArrowNavigationGroup } from '@fluentui/react-tabster';\nimport { OverflowMenu } from './OverflowMenu';\nimport { tokens } from '@fluentui/react-theme';\nimport { cloneLegendsToSVG } from '../../utilities/image-export-utils';\nimport { mergeClasses } from '@griffel/react';\n\n// This is an internal interface used for rendering the legends with unique key\ninterface LegendItem extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n name?: string;\n title: string;\n action: VoidFunction;\n hoverAction: VoidFunction;\n onMouseOutAction: VoidFunction;\n color: string;\n shape?: LegendShape;\n key: number;\n opacity?: number;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n legendAnnotation?: () => React.ReactNode;\n}\n\ninterface LegendMap {\n [key: string]: boolean;\n}\n\nexport interface LegendState {\n activeLegend: string;\n /** Set of legends selected, both for multiple selection and single selection */\n selectedLegends: LegendMap;\n}\nexport const Legends: React.FunctionComponent<LegendsProps> = React.forwardRef<HTMLDivElement, LegendsProps>(\n (props, forwardedRef) => {\n /** Boolean variable to check if one or more legends are selected */\n let _isLegendSelected = false;\n const _rootElem = React.useRef<HTMLDivElement | null>(null);\n\n // set states separately for each instance of the component\n const [activeLegend, setActiveLegend] = React.useState('');\n const [selectedLegends, setSelectedLegends] = React.useState<LegendMap>(() => Object.create(null));\n const focusAttributes = useFocusableGroup();\n const arrowAttributes = useArrowNavigationGroup({ axis: 'horizontal', memorizeCurrent: true });\n const classes = useLegendStyles(props);\n const toSVG = React.useCallback(\n (svgWidth: number, isRTL: boolean = false) => {\n return cloneLegendsToSVG(\n props.legends,\n svgWidth,\n {\n selectedLegends,\n centerLegends: !!props.centerLegends,\n textClassName: classes.text!,\n isRTL,\n },\n _rootElem.current,\n );\n },\n [props.legends, props.centerLegends, selectedLegends, classes.text],\n );\n\n React.useImperativeHandle(props.legendRef, () => ({\n toSVG,\n }));\n\n React.useEffect(() => {\n const initialSelectedLegends = props.selectedLegends ?? props.defaultSelectedLegends;\n const initialSelectedLegend = props.selectedLegend ?? props.defaultSelectedLegend;\n const selectedLegendsState: LegendMap = Object.create(null);\n if (props.canSelectMultipleLegends) {\n [...(initialSelectedLegends ?? [])].reverse().forEach(key => {\n selectedLegendsState[key] = true;\n });\n setSelectedLegends(selectedLegendsState);\n } else if (initialSelectedLegend !== undefined) {\n selectedLegendsState[initialSelectedLegend] = true;\n setSelectedLegends(selectedLegendsState);\n }\n }, [\n props.canSelectMultipleLegends,\n props.defaultSelectedLegend,\n props.defaultSelectedLegends,\n props.selectedLegend,\n props.selectedLegends,\n ]);\n\n _isLegendSelected = Object.keys(selectedLegends).length > 0;\n const dataToRender = _generateData();\n const { overflowStyles, allowFocusOnLegends = true, canSelectMultipleLegends = false } = props;\n const itemIds = dataToRender.map((_item, index) => index.toString());\n const overflowHoverCardLegends: JSXElement[] = [];\n dataToRender.map((legend, index) => {\n const hoverCardElement = _renderButton(legend, index, true);\n overflowHoverCardLegends.push(hoverCardElement);\n });\n const overflowString = props.overflowText ? props.overflowText : 'more';\n return props.enabledWrapLines ? renderWrappedLegends() : renderLegends();\n\n function renderLegends(): JSXElement {\n return (\n <div {...focusAttributes} {...arrowAttributes} className={classes.root} ref={_rootElem}>\n <Overflow>\n <div className={classes.resizableArea} style={{ textAlign: props.centerLegends ? 'center' : 'unset' }}>\n {/*\n Only the selectable options belong to the listbox; the overflow trigger stays a sibling so a\n menu button is not treated as a listbox child. `display: contents` keeps the options as direct\n flex participants so overflow measurement is unaffected.\n */}\n <div\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ display: 'contents' }}\n >\n {dataToRender.map((item, id) => (\n <OverflowItem key={id} id={id.toString()}>\n {_renderButton(item, id)}\n </OverflowItem>\n ))}\n </div>\n <OverflowMenu itemIds={itemIds} title={`${overflowString}`} items={overflowHoverCardLegends} />\n </div>\n </Overflow>\n </div>\n );\n }\n\n function renderWrappedLegends(): JSXElement {\n return (\n <div\n {...focusAttributes}\n {...arrowAttributes}\n {...(allowFocusOnLegends && {\n role: 'listbox',\n 'aria-label': 'Legends',\n 'aria-multiselectable': canSelectMultipleLegends,\n })}\n style={{ justifyContent: props.centerLegends ? 'center' : 'unset', flexWrap: 'wrap', ...overflowStyles }}\n className={classes.root}\n ref={_rootElem}\n >\n <div className={classes.resizableArea} style={{ display: 'flex', flexWrap: 'wrap', overflow: 'auto' }}>\n {dataToRender.map((item, id) => (\n <div\n className={mergeClasses(classes.legendContainer, item.legendAnnotation && classes.annotation)}\n key={item.key}\n >\n {_renderButton(item, id)}\n {item.legendAnnotation && <div>{item.legendAnnotation()}</div>}\n </div>\n ))}\n </div>\n </div>\n );\n }\n\n function _generateData(): LegendItem[] {\n const { /*allowFocusOnLegends = true,*/ shape } = props;\n const dataItems: LegendItem[] = props.legends.map((legend: Legend, index: number) => {\n return {\n /* ...(allowFocusOnLegends && {\n nativeButtonProps: getIntrinsicElementProps(\n 'div',\n {\n legend,\n ...buttonProperties,\n },\n ['title'],\n ),\n 'aria-setsize': props.legends.length,\n 'aria-posinset': index + 1,\n }), */\n title: legend.title,\n action: legend.action!,\n hoverAction: legend.hoverAction!,\n onMouseOutAction: legend.onMouseOutAction!,\n color: legend.color,\n shape: shape ? shape : legend.shape,\n stripePattern: legend.stripePattern,\n isLineLegendInBarChart: legend.isLineLegendInBarChart,\n opacity: legend.opacity,\n key: index,\n legendAnnotation: legend.legendAnnotation,\n };\n });\n return dataItems;\n }\n\n /**\n * Determine whether the component is in \"controlled\" mode for selections, where the selected legend(s) are\n * determined entirely by props passed in from the parent component.\n */\n function _isInControlledMode(): boolean {\n return props.canSelectMultipleLegends ? props.selectedLegends !== undefined : props.selectedLegend !== undefined;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when multi-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend(s) state data.\n */\n function _getNewSelectedLegendsForMultiselect(legend: Legend): { [key: string]: boolean } {\n let legendsSelected: LegendMap = Object.assign(Object.create(null), selectedLegends);\n if (legendsSelected[legend.title]) {\n // Delete entry for the deselected legend to make\n // the number of keys equal to the number of selected legends\n delete legendsSelected[legend.title];\n } else {\n legendsSelected[legend.title] = true;\n // Clear set if all legends are selected\n if (Object.keys(legendsSelected).length === props.legends.length) {\n legendsSelected = Object.create(null);\n }\n }\n return legendsSelected;\n }\n\n /**\n * Get the new selected legends based on the legend that was clicked when single-select is enabled.\n * @param legend The legend that was clicked\n * @returns An object with the new selected legend state data.\n */\n function _getNewSelectedLegendsForSingleSelect(legend: Legend): { [key: string]: boolean } {\n const legendsSelected: LegendMap = Object.create(null);\n if (!selectedLegends[legend.title]) {\n legendsSelected[legend.title] = true;\n }\n return legendsSelected;\n }\n\n function _onClick(legend: Legend, event: React.MouseEvent<HTMLButtonElement>): void {\n const { canSelectMultipleLegends = false } = props;\n const nextSelectedLegends = canSelectMultipleLegends\n ? _getNewSelectedLegendsForMultiselect(legend)\n : _getNewSelectedLegendsForSingleSelect(legend);\n\n if (!_isInControlledMode()) {\n setSelectedLegends(nextSelectedLegends);\n }\n props.onChange?.(Object.keys(nextSelectedLegends), event, legend);\n legend.action?.();\n }\n\n function _onHoverOverLegend(legend: Legend) {\n if (legend.hoverAction) {\n setActiveLegend(legend.title);\n legend.hoverAction();\n }\n }\n\n function _onLeave(legend: Legend) {\n if (legend.onMouseOutAction) {\n setActiveLegend('');\n legend.onMouseOutAction();\n }\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function _renderButton(data: any, index?: number, isOverflowItem?: boolean) {\n const { allowFocusOnLegends = true } = props;\n // Overflow legends are rendered inside a menu, not the listbox, so they must not carry `option` semantics.\n const showListboxOption = allowFocusOnLegends && !isOverflowItem;\n const legend: Legend = {\n title: data.title,\n color: data.color,\n shape: data.shape,\n action: data.action,\n hoverAction: data.hoverAction,\n onMouseOutAction: data.onMouseOutAction,\n stripePattern: data.stripePattern,\n isLineLegendInBarChart: data.isLineLegendInBarChart,\n opacity: data.opacity,\n };\n const color = _getColor(legend.title, legend.color);\n const onClickHandler = (event: React.MouseEvent<HTMLElement>) => {\n _onClick(legend, event as React.MouseEvent<HTMLButtonElement>);\n };\n const onHoverHandler = () => {\n _onHoverOverLegend(legend);\n };\n const onMouseOut = () => {\n _onLeave(legend);\n };\n const shape = _getShape(legend, color);\n const legendStyle = {\n '--rect-height': legend.isLineLegendInBarChart ? '4px' : '12px',\n '--rect-backgroundColor': legend.stripePattern ? '' : color,\n '--rect-borderColor': legend.color ? legend.color : tokens.colorNeutralStroke1,\n '--rect-content': legend.stripePattern\n ? `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n } as React.CSSProperties;\n const legendContent = (\n <>\n {shape}\n <div className={classes.text} style={{ opacity: color === tokens.colorNeutralBackground1 ? '0.67' : '' }}>\n {legend.title}\n </div>\n </>\n );\n // Shared by the listbox Button and the overflow div. Hover/focus handlers are included so the overflow\n // menu can forward them to its item (the div itself never receives focus).\n const commonProps: React.HTMLAttributes<HTMLElement> = {\n className: classes.legend,\n onClick: onClickHandler,\n onMouseOver: onHoverHandler,\n onMouseOut: onMouseOut,\n onFocus: onHoverHandler,\n onBlur: onMouseOut,\n style: legendStyle,\n };\n if (isOverflowItem) {\n // In the overflow menu the item itself is interactive, so keep this content a non-interactive div to\n // avoid nested clickable elements. display:flex lays the swatch and label out inline (a bare div would\n // stack them). data-selected / data-title are read by the overflow menu to drive its checked state.\n return (\n <div\n key={index}\n {...commonProps}\n data-selected={!!selectedLegends[legend.title]}\n data-title={legend.title}\n style={{ ...legendStyle, display: 'flex', alignItems: 'center' }}\n >\n {legendContent}\n </div>\n );\n }\n return (\n <Button\n {...(showListboxOption && {\n 'aria-selected': !!selectedLegends[legend.title],\n role: 'option',\n 'aria-label': `${legend.title}`,\n // Full-list position so counts match the overflow menu.\n 'aria-setsize': props.legends.length,\n 'aria-posinset': (index ?? 0) + 1,\n })}\n {...(data.nativeButtonProps && { ...data.nativeButtonProps })}\n key={index}\n {...commonProps}\n appearance={'outline'}\n size=\"small\"\n >\n {legendContent}\n </Button>\n );\n }\n\n function _getShape(legend: Legend, color: string): React.ReactNode | string {\n const svgParentProps: React.SVGAttributes<SVGElement> = {\n className: classes.shape,\n };\n const svgChildProps: React.SVGAttributes<SVGElement> = {\n fill: color,\n strokeWidth: 2,\n stroke: legend.color,\n };\n return (\n <Shape\n svgProps={svgParentProps}\n pathProps={svgChildProps}\n shape={legend.shape as LegendShape}\n classNameForNonSvg={classes.rect}\n style={\n {\n height: legend.isLineLegendInBarChart ? '4px' : '12px',\n backgroundColor: legend.stripePattern ? '' : color,\n borderColor: legend.color ? legend.color : tokens.colorNeutralStroke1,\n content: legend.stripePattern\n ? `repeating-linear-gradient(135deg, transparent, transparent 3px, ${color} 1px, ${color} 4px)`\n : '',\n '--rect-content-high-contrast': `linear-gradient(to right, ${color}, ${color})`,\n '--rect-opacity-high-contrast': color === tokens.colorNeutralBackground1 ? '0.6' : '',\n } as React.CSSProperties\n }\n />\n );\n }\n\n function _getColor(title: string, color: string): string {\n let legendColor = color;\n // if one or more legends are selected\n if (_isLegendSelected) {\n // if the given legend (title) is one of the selected legends\n if (selectedLegends[title]) {\n legendColor = color;\n }\n // if the given legend is unselected\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n // if no legend is selected\n else {\n // if the given legend is hovered\n // or none of the legends is hovered\n if (activeLegend === title || activeLegend === '') {\n legendColor = color;\n }\n // if there is a hovered legend but the given legend is not the one\n else {\n legendColor = tokens.colorNeutralBackground1;\n }\n }\n return legendColor;\n }\n },\n);\nLegends.displayName = 'Legends';\n"],"names":["React","Button","Shape","useLegendStyles","Overflow","OverflowItem","useFocusableGroup","useArrowNavigationGroup","OverflowMenu","tokens","cloneLegendsToSVG","mergeClasses","Legends","forwardRef","props","forwardedRef","_isLegendSelected","_rootElem","useRef","activeLegend","setActiveLegend","useState","selectedLegends","setSelectedLegends","Object","create","focusAttributes","arrowAttributes","axis","memorizeCurrent","classes","toSVG","useCallback","svgWidth","isRTL","legends","centerLegends","textClassName","text","current","useImperativeHandle","legendRef","useEffect","initialSelectedLegends","defaultSelectedLegends","initialSelectedLegend","selectedLegend","defaultSelectedLegend","selectedLegendsState","canSelectMultipleLegends","reverse","forEach","key","undefined","keys","length","dataToRender","_generateData","overflowStyles","allowFocusOnLegends","itemIds","map","_item","index","toString","overflowHoverCardLegends","legend","hoverCardElement","_renderButton","push","overflowString","overflowText","enabledWrapLines","renderWrappedLegends","renderLegends","div","className","root","ref","resizableArea","style","textAlign","role","display","item","id","title","items","justifyContent","flexWrap","overflow","legendContainer","legendAnnotation","annotation","shape","dataItems","action","hoverAction","onMouseOutAction","color","stripePattern","isLineLegendInBarChart","opacity","_isInControlledMode","_getNewSelectedLegendsForMultiselect","legendsSelected","assign","_getNewSelectedLegendsForSingleSelect","_onClick","event","nextSelectedLegends","onChange","_onHoverOverLegend","_onLeave","data","isOverflowItem","showListboxOption","_getColor","onClickHandler","onHoverHandler","onMouseOut","_getShape","legendStyle","colorNeutralStroke1","legendContent","colorNeutralBackground1","commonProps","onClick","onMouseOver","onFocus","onBlur","data-selected","data-title","alignItems","nativeButtonProps","appearance","size","svgParentProps","svgChildProps","fill","strokeWidth","stroke","svgProps","pathProps","classNameForNonSvg","rect","height","backgroundColor","borderColor","content","legendColor","displayName"],"mappings":"AAAA;;;;;+BAyCaY;;;;;;;iEAvCU,QAAQ;6BAGR,yBAAyB;uBAE1B,aAAU;wCACA,+BAA4B;+BACrB,2BAA2B;8BACP,0BAA0B;8BACxD,oBAAiB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,GAAG,QAAQ;gBAChD8C,iBAAiBjF,OAAOkC,aAAa,GAAG,KAAKD;gBAC7CiD,aAAalF,OAAOiC,KAAK,GAAGjC,OAAOiC,KAAK,GAAG1F,kBAAAA,CAAOkH,mBAAmB;gBACrE0B,SAASnF,OAAOkC,aAAa,GACzB,CAAC,gEAAgE,EAAED,MAAM,MAAM,EAAEA,MAAM,KAAK,CAAC,GAC7F;gBACJ,gCAAgC,CAAC,0BAA0B,EAAEA,MAAM,EAAE,EAAEA,MAAM,CAAC,CAAC;gBAC/E,gCAAgCA,UAAU1F,kBAAAA,CAAOoH,uBAAuB,GAAG,QAAQ;YACrF;;IAIR;IAEA,SAASR,UAAU/B,KAAa,EAAEa,KAAa;QAC7C,IAAImD,cAAcnD;QAClB,sCAAsC;QACtC,IAAInF,mBAAmB;YACrB,6DAA6D;YAC7D,IAAIM,eAAe,CAACgE,MAAM,EAAE;gBAC1BgE,cAAcnD;YAChB,OAEK;gBACHmD,cAAc7I,kBAAAA,CAAOoH,uBAAuB;YAC9C;QACF,OAEK;YACH,iCAAiC;YACjC,oCAAoC;YACpC,IAAI1G,iBAAiBmE,SAASnE,iBAAiB,IAAI;gBACjDmI,cAAcnD;YAChB,OAEK;gBACHmD,cAAc7I,kBAAAA,CAAOoH,uBAAuB;YAC9C;QACF;QACA,OAAOyB;IACT;AACF,GACA;AACF1I,QAAQ2I,WAAW,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Legends/Legends.types.ts"],"sourcesContent":["import type * as React from 'react';\nimport type { CustomPoints, Points } from '../../utilities/utilities';\n\n/**\n * Legends styles\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface LegendsStyles {\n /**\n * Style set for the root of the legend component\n */\n root?: string;\n\n /**\n * Style set for Legend. This is a wrapping class for text of legend and the rectange box that represents a legend\n */\n legend?: string;\n\n /**\n * Style set for the rectangle that represents a legend\n */\n rect?: string;\n\n /**\n * styles set for the shape that represents a legend\n */\n shape?: string;\n\n /**\n * Style set for the triangle that represents a legend\n */\n triangle?: string;\n\n /**\n * Style for the legend text\n */\n text?: string;\n\n /**\n * Style for the legend text\n */\n hoverChange?: string;\n\n /**\n * Style for the area that is resizable\n */\n resizableArea?: string;\n\n /*\n * Style for the container that holds the legend and any optional JSX annotation from client is used\n */\n legendContainer?: string;\n\n /**\n * Style for the annotation that is used in the legend\n */\n annotation?: string;\n}\n\n/**\n * ILegend interface\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface Legend {\n /**\n * Defines the title of the legend\n */\n title: string;\n\n /**\n * Defines the function that is executed on clicking this legend\n */\n action?: VoidFunction;\n\n /**\n * Defines the function that is executed upon hovering over the legend\n */\n hoverAction?: VoidFunction;\n\n /**\n * Defines the function that is executed upon moving the mouse away from the legend\n */\n onMouseOutAction?: (isLegendFocused?: boolean) => void;\n\n /**\n * The color for the legend\n */\n color: string;\n\n /**\n * The opacity of the legend color\n */\n opacity?: number;\n\n /**\n * The shape for the legend\n */\n shape?: LegendShape;\n\n /**\n * Indicated whether or not to apply stripe pattern\n */\n stripePattern?: boolean;\n\n /**\n * Indicates if the legend belongs to a line in the Bar Chart\n */\n isLineLegendInBarChart?: boolean;\n\n /*\n * native button props for the legend button\n */\n nativeButtonProps?: React.ButtonHTMLAttributes<HTMLButtonElement>;\n\n /**\n * The annotation for the legend, function returning a React node\n */\n legendAnnotation?: () => React.ReactNode;\n}\n\n/**\n * Legend style properties\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface LegendStyleProps {\n className?: string;\n colorOnSelectedState?: string;\n borderColor?: string;\n opacity?: number;\n overflow?: boolean;\n stripePattern?: boolean;\n isLineLegendInBarChart?: boolean;\n}\n\n/**\n * Legend properties\n * {@docCategory Legends}\n *\n * @public\n */\nexport interface LegendsProps {\n /**\n * Prop that takes list of legends\n */\n legends: Legend[];\n\n /**\n * Additional CSS class(es) to apply to the legneds component.\n */\n className?: string;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: LegendsStyles;\n\n /**\n * This prop makes the legends component align itself to the center in the container it is sitting in\n */\n centerLegends?: boolean;\n\n /**\n * Enable the legends to wrap lines if there is not enough space to show all legends on a single line\n */\n enabledWrapLines?: boolean;\n\n /**\n * style for the overflow component\n */\n overflowStyles?: React.CSSProperties;\n\n /**\n * text for overflow legends string\n */\n overflowText?: string;\n\n /**\n * prop that decides if legends are focusable\n * @default true\n */\n allowFocusOnLegends?: boolean;\n\n /**\n * prop that decide if we can select multiple legends or single legend at a time\n * @default false\n */\n canSelectMultipleLegends?: boolean;\n\n /**\n * Callback issued when the selected option changes.\n */\n onChange?: (selectedLegends: string[], event: React.MouseEvent<HTMLButtonElement>, currentLegend?: Legend) => void;\n\n /**\n * Keys (title) that will be initially used to set selected items. This prop is used for multi-select scenarios when\n * canSelectMultipleLegends is true; for single-select, use defaultSelectedLegend.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegends instead.\n *\n * @see selectedLegends for setting the selected legends in controlled mode.\n * @see defaultSelectedLegend for setting the initially selected legend when canSelectMultipleLegends is false.\n */\n defaultSelectedLegends?: string[];\n\n /**\n * Key that will be initially used to set selected item. This prop is used for single-select scenarios when\n * canSelectMultipleLegends is false or unspecified; for multi-select, use defaultSelectedLegends.\n *\n * Updating this prop does not change the selection after the component has been initialized. For controlled\n * selections, use selectedLegend instead.\n *\n * @see selectedLegend for setting the selected legend in controlled mode.\n * @see defaultSelectedLegends for setting the initially selected legends when canSelectMultipleLegends is true.\n */\n defaultSelectedLegend?: string;\n\n /**\n * Keys (title) that will be used to set selected items in multi-select scenarios when canSelectMultipleLegends is\n * true. For single-select, use selectedLegend.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegends for setting the initially-selected legends in uncontrolled mode.\n * @see selectedLegends for setting the selected legends when `canSelectMultipleLegends` is `true`.\n */\n selectedLegends?: string[];\n\n /**\n * Key (title) that will be used to set the selected item in single-select scenarios when canSelectMultipleLegends is\n * false or unspecified. For multi-select, use selectedLegends.\n *\n * When this prop is provided, the component is controlled and does not automatically update the selection based on\n * user interactions; the parent component must update the value passed to this property by handling the onChange\n * event.\n *\n * @see defaultSelectedLegend for setting the initially-selected legend in uncontrolled mode.\n * @see selectedLegend for setting the selected legend when `canSelectMultipleLegends` is `false`.\n */\n selectedLegend?: string;\n\n /**\n * The shape for the legend.\n */\n shape?: LegendShape;\n\n /**\n * Callback to access the public methods and properties of the component.\n */\n legendRef?: React.Ref<LegendContainer>;\n}\n\n/**\n * The shape for the legend\n * default: show the rect legend\n * triangle: show the triangle legend\n * {@docCategory Legends}\n *\n * @public\n */\nexport type LegendShape = 'default' | 'triangle' | keyof typeof Points | keyof typeof CustomPoints;\n\n/**\n * {@docCategory Legends}\n */\nexport interface LegendContainer {\n toSVG: (\n svgWidth: number,\n isRTL?: boolean,\n ) => {\n node: SVGSVGElement | null;\n width: number;\n height: number;\n };\n}\n"],"names":[],"mappings":"AA8QA;;CAEC,GACD,WASC"}
|
|
@@ -15,29 +15,31 @@ const _reactmenu = require("@fluentui/react-menu");
|
|
|
15
15
|
const _reactbutton = require("@fluentui/react-button");
|
|
16
16
|
const _reactoverflow = require("@fluentui/react-overflow");
|
|
17
17
|
const OverflowMenu = ({ itemIds, title, items })=>{
|
|
18
|
-
const { ref,
|
|
19
|
-
|
|
20
|
-
displayLabel = title === '' ? `+${overflowCount} items` : `+${overflowCount} ${title}`;
|
|
18
|
+
const { ref, isOverflowing } = (0, _reactoverflow.useOverflowMenu)();
|
|
19
|
+
const { itemVisibility } = (0, _reactoverflow.useOverflowVisibility)();
|
|
21
20
|
if (!isOverflowing) {
|
|
22
21
|
return null;
|
|
23
22
|
}
|
|
24
|
-
const remainingItemsCount = itemIds.length - overflowCount;
|
|
25
23
|
const checkedLegends = [];
|
|
26
24
|
const menuList = [];
|
|
27
|
-
for(let
|
|
28
|
-
const buttonElement = items[i];
|
|
25
|
+
for(let index = 0; index < items.length; index++){
|
|
29
26
|
var _buttonElement_props_datatitle;
|
|
30
|
-
const
|
|
27
|
+
const itemId = itemIds[index];
|
|
28
|
+
if (itemVisibility[itemId] !== false) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
const buttonElement = items[index];
|
|
32
|
+
const value = `${(_buttonElement_props_datatitle = buttonElement.props['data-title']) !== null && _buttonElement_props_datatitle !== void 0 ? _buttonElement_props_datatitle : index}`;
|
|
31
33
|
if (buttonElement.props['data-selected']) {
|
|
32
34
|
checkedLegends.push(value);
|
|
33
35
|
}
|
|
34
36
|
menuList.push(/*#__PURE__*/ _react.createElement(_reactmenu.MenuItemCheckbox, {
|
|
35
|
-
key:
|
|
37
|
+
key: itemId,
|
|
36
38
|
name: "legends",
|
|
37
39
|
value: value,
|
|
38
40
|
// Full-list position so counts match the listbox.
|
|
39
41
|
"aria-setsize": itemIds.length,
|
|
40
|
-
"aria-posinset":
|
|
42
|
+
"aria-posinset": index + 1,
|
|
41
43
|
// Hide the checkmark so the row matches the listbox legend; selection is conveyed via aria-checked.
|
|
42
44
|
checkmark: null,
|
|
43
45
|
onClick: (e)=>{
|
|
@@ -69,6 +71,7 @@ const OverflowMenu = ({ itemIds, title, items })=>{
|
|
|
69
71
|
onBlur: undefined
|
|
70
72
|
})));
|
|
71
73
|
}
|
|
74
|
+
const displayLabel = title === '' ? `+${menuList.length} items` : `+${menuList.length} ${title}`;
|
|
72
75
|
return /*#__PURE__*/ _react.createElement(_reactmenu.Menu, null, /*#__PURE__*/ _react.createElement(_reactmenu.MenuTrigger, {
|
|
73
76
|
disableButtonEnhancement: true
|
|
74
77
|
}, /*#__PURE__*/ _react.createElement(_reactbutton.MenuButton, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Legends/OverflowMenu.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { JSXElement } from '@fluentui/react-utilities';\nimport { Menu, MenuTrigger, MenuPopover, MenuList, MenuItemCheckbox } from '@fluentui/react-menu';\nimport { MenuButton } from '@fluentui/react-button';\nimport { useOverflowMenu, useOverflowVisibility } from '@fluentui/react-overflow';\n\nexport const OverflowMenu: React.FC<{\n itemIds: string[];\n title: string;\n items: JSXElement[];\n}> = ({ itemIds, title, items }) => {\n const { ref, isOverflowing } = useOverflowMenu<HTMLButtonElement>();\n const { itemVisibility } = useOverflowVisibility();\n\n if (!isOverflowing) {\n return null;\n }\n const checkedLegends: string[] = [];\n const menuList = [];\n for (let index = 0; index < items.length; index++) {\n const itemId = itemIds[index];\n if (itemVisibility[itemId] !== false) {\n continue;\n }\n const buttonElement = items[index];\n const value = `${buttonElement.props['data-title'] ?? index}`;\n if (buttonElement.props['data-selected']) {\n checkedLegends.push(value);\n }\n menuList.push(\n <MenuItemCheckbox\n key={itemId}\n name=\"legends\"\n value={value}\n // Full-list position so counts match the listbox.\n aria-setsize={itemIds.length}\n aria-posinset={index + 1}\n // Hide the checkmark so the row matches the listbox legend; selection is conveyed via aria-checked.\n checkmark={null}\n onClick={e => buttonElement.props.onClick?.(e)}\n // The content is smaller than the row, so handle hover/focus on the item to cover its full area.\n onMouseEnter={() => buttonElement.props.onMouseOver?.()}\n onMouseLeave={() => buttonElement.props.onMouseOut?.()}\n onFocus={() => buttonElement.props.onFocus?.()}\n onBlur={() => buttonElement.props.onBlur?.()}\n >\n {React.cloneElement(buttonElement, {\n onClick: undefined,\n onMouseOver: undefined,\n onMouseOut: undefined,\n onFocus: undefined,\n onBlur: undefined,\n })}\n </MenuItemCheckbox>,\n );\n }\n const displayLabel = title === '' ? `+${menuList.length} items` : `+${menuList.length} ${title}`;\n\n return (\n <Menu>\n <MenuTrigger disableButtonEnhancement>\n <MenuButton ref={ref}>{displayLabel}</MenuButton>\n </MenuTrigger>\n\n <MenuPopover>\n <MenuList aria-label=\"Legends\" checkedValues={{ legends: checkedLegends }}>\n {menuList}\n </MenuList>\n </MenuPopover>\n </Menu>\n );\n};\n"],"names":["React","Menu","MenuTrigger","MenuPopover","MenuList","MenuItemCheckbox","MenuButton","useOverflowMenu","useOverflowVisibility","OverflowMenu","itemIds","title","items","ref","isOverflowing","itemVisibility","checkedLegends","menuList","index","length","buttonElement","itemId","value","props","push","key","name","aria-setsize","aria-posinset","checkmark","onClick","e","onMouseEnter","onMouseOver","onMouseLeave","onMouseOut","onFocus","onBlur","cloneElement","undefined","displayLabel","disableButtonEnhancement","aria-label","checkedValues","legends"],"mappings":"AAAA;;;;;+BAQaS;;;;;;;iEANU,QAAQ;2BAE4C,uBAAuB;6BACvE,yBAAyB;+BACG,2BAA2B;AAE3E,qBAIF,CAAC,EAAEC,OAAO,EAAEC,KAAK,EAAEC,KAAK,EAAE;IAC7B,MAAM,EAAEC,GAAG,EAAEC,aAAa,EAAE,OAAGP,8BAAAA;IAC/B,MAAM,EAAEQ,cAAc,EAAE,OAAGP,oCAAAA;IAE3B,IAAI,CAACM,eAAe;QAClB,OAAO;IACT;IACA,MAAME,iBAA2B,EAAE;IACnC,MAAMC,WAAW,EAAE;IACnB,IAAK,IAAIC,QAAQ,GAAGA,QAAQN,MAAMO,MAAM,EAAED,QAAS;YAMhCE;QALjB,MAAMC,SAASX,OAAO,CAACQ,MAAM;QAC7B,IAAIH,cAAc,CAACM,OAAO,KAAK,OAAO;YACpC;QACF;QACA,MAAMD,gBAAgBR,KAAK,CAACM,MAAM;QAClC,MAAMI,QAAQ,GAAA,CAAGF,iCAAAA,cAAcG,KAAK,CAAC,aAAA,AAAa,MAAA,QAAjCH,mCAAAA,KAAAA,IAAAA,iCAAqCF,OAAO;QAC7D,IAAIE,cAAcG,KAAK,CAAC,gBAAgB,EAAE;YACxCP,eAAeQ,IAAI,CAACF;QACtB;QACAL,SAASO,IAAI,CAAA,WAAA,GACX,OAAA,aAAA,CAACnB,2BAAAA,EAAAA;YACCoB,KAAKJ;YACLK,MAAK;YACLJ,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AC,CAAC,EAAEF,SAASE,MAAM,CAAC,CAAC,EAAER,OAAO;IAEhG,OAAA,WAAA,GACE,OAAA,aAAA,CAACV,eAAAA,EAAAA,MAAAA,WAAAA,GACC,OAAA,aAAA,CAACC,sBAAAA,EAAAA;QAAYuC,0BAAAA;qBACX,OAAA,aAAA,CAACnC,uBAAAA,EAAAA;QAAWO,KAAKA;OAAM2B,gBAAAA,WAAAA,GAGzB,OAAA,aAAA,CAACrC,sBAAAA,EAAAA,MAAAA,WAAAA,GACC,OAAA,aAAA,CAACC,mBAAAA,EAAAA;QAASsC,cAAW;QAAUC,eAAe;YAAEC,SAAS5B;QAAe;OACrEC;AAKX,EAAE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Legends/index.ts"],"sourcesContent":["export * from './Legends';\nexport * from './Legends.types';\nexport * from './shape';\n"],"names":[],"mappings":";;;;;uBAAc,eAAY;uBACZ,qBAAkB;uBAClB,aAAU"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Legends/shape.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport type { LegendShape } from './Legends.types';\nimport { CustomPoints, Points, getSecureProps } from '../../utilities/utilities';\n\nexport interface ShapeProps {\n svgProps: React.SVGAttributes<SVGElement>;\n pathProps: React.SVGAttributes<SVGPathElement>;\n shape: LegendShape;\n classNameForNonSvg?: string;\n style?: React.CSSProperties | undefined;\n}\n\ntype PointPathType = {\n [key: string]: string;\n};\n\nconst pointPath: PointPathType = {\n [`${Points[Points.circle]}`]: 'M1 6 A5 5 0 1 0 12 6 M1 6 A5 5 0 0 1 12 6',\n [`${Points[Points.square]}`]: 'M1 1 L12 1 L12 12 L1 12 L1 1 Z',\n [`${Points[Points.triangle]}`]: 'M6 10L8.74228e-07 -1.04907e-06L12 0L6 10Z',\n [`${Points[Points.pyramid]}`]: 'M6 10L8.74228e-07 -1.04907e-06L12 0L6 10Z',\n [`${Points[Points.diamond]}`]: 'M2 2 L10 2 L10 10 L2 10 L2 2 Z',\n [`${Points[Points.hexagon]}`]: 'M9 0H3L0 5L3 10H9L12 5L9 0Z',\n [`${Points[Points.pentagon]}`]: 'M6.06061 0L0 4.21277L2.30303 11H9.69697L12 4.21277L6.06061 0Z',\n [`${Points[Points.octagon]}`]:\n 'M7.08333 0H2.91667L0 2.91667V7.08333L2.91667 10H7.08333L10 7.08333V2.91667L7.08333 0Z',\n [`${CustomPoints[CustomPoints.dottedLine]}`]: 'M0 6 H3 M5 6 H8 M10 6 H13',\n};\n\nexport const Shape: React.FunctionComponent<ShapeProps> = React.forwardRef<HTMLDivElement, ShapeProps>(\n ({ svgProps, pathProps, shape, classNameForNonSvg, style }, forwardedRef) => {\n if (Object.keys(pointPath).indexOf(shape) === -1) {\n return <div className={classNameForNonSvg} style={style} />;\n }\n return (\n <svg\n width={14}\n height={14}\n viewBox={'-1 -1 14 14'}\n {...getSecureProps(svgProps)}\n transform={`rotate(${\n shape === Points[Points.diamond] ? 45 : shape === Points[Points.pyramid] ? 180 : 0\n }, 0, 0)`}\n style={{\n width: '14px',\n height: '14px',\n }}\n >\n <path d={pointPath[shape]} {...getSecureProps(pathProps)} />\n </svg>\n );\n },\n);\n"],"names":["React","CustomPoints","Points","getSecureProps","pointPath","circle","square","triangle","pyramid","diamond","hexagon","pentagon","octagon","dottedLine","Shape","forwardRef","svgProps","pathProps","shape","classNameForNonSvg","style","forwardedRef","Object","keys","indexOf","div","className","svg","width","height","viewBox","transform","path","d"],"mappings":"AAAA;;;;;+BA+Bac;;;;;;;iEA7BU,QAAQ;2BAEsB,+BAA4B;AAcjF,MAAMV,YAA2B;IAC/B,CAAC,GAAGF,iBAAM,CAACA,iBAAAA,CAAOG,MAAM,CAAC,EAAE,CAAC,EAAE;IAC9B,CAAC,GAAGH,iBAAM,CAACA,iBAAAA,CAAOI,MAAM,CAAC,EAAE,C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G,QAAAA;QAAKC,GAAG7B,SAAS,CAACc,MAAM;QAAG,OAAGf,yBAAAA,EAAec,UAAU;;AAG9D,GACA"}
|
|
@@ -6,38 +6,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
INACTIVE_LEGEND_TEXT_OPACITY
|
|
13
|
+
get INACTIVE_LEGEND_TEXT_OPACITY () {
|
|
14
14
|
return INACTIVE_LEGEND_TEXT_OPACITY;
|
|
15
15
|
},
|
|
16
|
-
LEGEND_CONTAINER_MARGIN_START
|
|
16
|
+
get LEGEND_CONTAINER_MARGIN_START () {
|
|
17
17
|
return LEGEND_CONTAINER_MARGIN_START;
|
|
18
18
|
},
|
|
19
|
-
LEGEND_CONTAINER_MARGIN_TOP
|
|
19
|
+
get LEGEND_CONTAINER_MARGIN_TOP () {
|
|
20
20
|
return LEGEND_CONTAINER_MARGIN_TOP;
|
|
21
21
|
},
|
|
22
|
-
LEGEND_HEIGHT
|
|
22
|
+
get LEGEND_HEIGHT () {
|
|
23
23
|
return LEGEND_HEIGHT;
|
|
24
24
|
},
|
|
25
|
-
LEGEND_PADDING
|
|
25
|
+
get LEGEND_PADDING () {
|
|
26
26
|
return LEGEND_PADDING;
|
|
27
27
|
},
|
|
28
|
-
LEGEND_SHAPE_BORDER
|
|
28
|
+
get LEGEND_SHAPE_BORDER () {
|
|
29
29
|
return LEGEND_SHAPE_BORDER;
|
|
30
30
|
},
|
|
31
|
-
LEGEND_SHAPE_MARGIN_END
|
|
31
|
+
get LEGEND_SHAPE_MARGIN_END () {
|
|
32
32
|
return LEGEND_SHAPE_MARGIN_END;
|
|
33
33
|
},
|
|
34
|
-
LEGEND_SHAPE_SIZE
|
|
34
|
+
get LEGEND_SHAPE_SIZE () {
|
|
35
35
|
return LEGEND_SHAPE_SIZE;
|
|
36
36
|
},
|
|
37
|
-
legendClassNames
|
|
37
|
+
get legendClassNames () {
|
|
38
38
|
return legendClassNames;
|
|
39
39
|
},
|
|
40
|
-
useLegendStyles
|
|
40
|
+
get useLegendStyles () {
|
|
41
41
|
return useLegendStyles;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["useLegendsStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens, typographyStyles } from \"@fluentui/react-theme\";\nimport { HighContrastSelector } from \"../../utilities/index.js\";\n// Constants needed to create legends using SVG for image export\nexport const LEGEND_CONTAINER_MARGIN_TOP = 8;\nexport const LEGEND_CONTAINER_MARGIN_START = 12;\nexport const LEGEND_PADDING = 8;\nexport const LEGEND_HEIGHT = 32;\nexport const LEGEND_SHAPE_BORDER = 1;\nconst LEGEND_SHAPE_SIZE_WITHOUT_BORDER = 12;\n// SVG strokes are drawn centered around the path, with half of the stroke width extending inward\n// (overlapping the fill area) and half outward. To ensure the filled area maintains its intended size,\n// expand the shape accordingly.\nexport const LEGEND_SHAPE_SIZE = LEGEND_SHAPE_SIZE_WITHOUT_BORDER + LEGEND_SHAPE_BORDER;\nexport const LEGEND_SHAPE_MARGIN_END = 8;\nexport const INACTIVE_LEGEND_TEXT_OPACITY = 0.67;\n/**\n * @internal\n */ export const legendClassNames = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea',\n legendContainer: 'fui-legend__legendContainer',\n annotation: 'fui-legend__annotation'\n};\nconst useStyles = makeStyles({\n root: {\n // FIXME: Removing this style allows the legend container in responsive donut chart to resize\n // properly (horizontally) within a flexbox or grid layout. But it causes vertical resizing issues\n // in responsive charts where legends consist of multiple words.\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center'\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n border: 'none',\n padding: `${LEGEND_PADDING}px`,\n textTransform: 'capitalize',\n // The default min-width is 64px. Setting it to 0 allows the legend container in responsive\n // cartesian charts to resize properly within a flexbox or grid layout.\n minWidth: 0,\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none',\n '&:focus-visible': {\n outline: `${tokens.strokeWidthThick} solid canvasText`,\n outlineOffset: `calc(${tokens.strokeWidthThick} * -1)`\n }\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none'\n }\n }\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)'\n },\n width: `${LEGEND_SHAPE_SIZE_WITHOUT_BORDER}px`,\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n border: `${LEGEND_SHAPE_BORDER}px solid`\n },\n shape: {\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n borderLeft: '6px solid transparent',\n borderRight: '6px solid transparent',\n borderTop: '10.4px solid',\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n // TO DO Add props when these styles are used in the component\n hoverChange: {\n width: '12px',\n height: '12px',\n marginRight: tokens.spacingHorizontalS,\n border: '1px solid'\n },\n resizableArea: {\n position: 'relative',\n textAlign: 'left',\n transform: 'translate(-50%, 0)',\n top: 'auto',\n left: '50%',\n minWidth: '200px',\n maxWidth: '800px',\n '::after': {\n padding: '1px 4px 1px',\n borderTop: '-2px',\n borderLeft: '-2px'\n }\n },\n legendContainer: {\n flex: '0 1 auto',\n margin: '4px'\n },\n annotation: {\n display: 'flex',\n alignItems: 'center',\n gap: '4px'\n }\n});\nexport const useLegendStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9;\n const { className } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n return {\n root: mergeClasses(legendClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n legend: mergeClasses(legendClassNames.legend, baseStyles.legend, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.legend),\n rect: mergeClasses(legendClassNames.rect, baseStyles.rect, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.rect),\n shape: mergeClasses(legendClassNames.shape, baseStyles.shape, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.shape),\n triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.triangle),\n text: mergeClasses(legendClassNames.text, baseStyles.text, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.text),\n hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.hoverChange),\n resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.resizableArea),\n legendContainer: mergeClasses(legendClassNames.legendContainer, baseStyles.legendContainer, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.legendContainer),\n annotation: mergeClasses(legendClassNames.annotation, baseStyles.annotation, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.annotation)\n };\n};\n"],"names":["__styles","mergeClasses","tokens","typographyStyles","HighContrastSelector","LEGEND_CONTAINER_MARGIN_TOP","LEGEND_CONTAINER_MARGIN_START","LEGEND_PADDING","LEGEND_HEIGHT","LEGEND_SHAPE_BORDER","LEGEND_SHAPE_SIZE_WITHOUT_BORDER","LEGEND_SHAPE_SIZE","LEGEND_SHAPE_MARGIN_END","INACTIVE_LEGEND_TEXT_OPACITY","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","legendContainer","annotation","useStyles","Huce71","a9b677","Bt984gj","Brf1p80","Bceei9c","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","B9bfxx9","Bf4jedk","ixv5ic","Bkoo3cm","F23esa","Icej2d","B9gsw3i","swriq4","awn1t","Blj5yig","Fdtwhm","Blctwrt","Bh9kdj0","t21cq0","Bqenvij","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","sj55zd","Bvjb7m6","qhf8xq","fsow6f","Bz10aip","Bhzewxz","oyh7mz","B2u0y6b","B4uzyy","Be2s5ez","u6pn5x","smv486","B1nu0jp","B0n5ga8","Bm2nyyq","xrcqlc","wywymt","Gp14am","vfts7","Bhxzhr1","Du69r6","xawz","Bh6795r","Bnnss6s","fkmc3a","jrapky","Frg6f3","B6of3ja","B74szlk","mc9l5x","i8kkvl","Belr9w4","rmohyg","d","p","m","useLegendStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","_props_styles8","_props_styles9","className","baseStyles","styles"],"mappings":"AAAA,YAAY;;;;;;;;;;;;IAgBCa,4BAA4B;;;IAV5BP,6BAA6B;;;+BADF;;;iBAGd;;;kBADC;;;IA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AAEmG,UAAU,CAACnG,aAAa,EAAE,CAAC+F,cAAc,GAAGR,KAAK,CAACa,MAAAA,AAAM,MAAM,IAAI,IAAIL,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,aAAa,CAAC;QACpMC,eAAe,MAAEtB,mBAAY,EAACa,gBAAgB,CAACS,eAAe,EAAEkG,UAAU,CAAClG,eAAe,EAAE,CAAC+F,cAAc,GAAGT,KAAK,CAACa,MAAAA,AAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,eAAe,CAAC;QAC5MC,UAAU,MAAEvB,mBAAY,EAACa,gBAAgB,CAACU,UAAU,EAAEiG,UAAU,CAACjG,UAAU,EAAE,CAAC+F,cAAc,GAAGV,KAAK,CAACa,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,UAAU;IAC3L,CAAC;AACL,CAAC"}
|
|
1
|
+
{"version":3,"sources":["useLegendsStyles.styles.js"],"sourcesContent":["'use client';\nimport { makeStyles, mergeClasses } from \"@griffel/react\";\nimport { tokens, typographyStyles } from \"@fluentui/react-theme\";\nimport { HighContrastSelector } from \"../../utilities/index.js\";\n// Constants needed to create legends using SVG for image export\nexport const LEGEND_CONTAINER_MARGIN_TOP = 8;\nexport const LEGEND_CONTAINER_MARGIN_START = 12;\nexport const LEGEND_PADDING = 8;\nexport const LEGEND_HEIGHT = 32;\nexport const LEGEND_SHAPE_BORDER = 1;\nconst LEGEND_SHAPE_SIZE_WITHOUT_BORDER = 12;\n// SVG strokes are drawn centered around the path, with half of the stroke width extending inward\n// (overlapping the fill area) and half outward. To ensure the filled area maintains its intended size,\n// expand the shape accordingly.\nexport const LEGEND_SHAPE_SIZE = LEGEND_SHAPE_SIZE_WITHOUT_BORDER + LEGEND_SHAPE_BORDER;\nexport const LEGEND_SHAPE_MARGIN_END = 8;\nexport const INACTIVE_LEGEND_TEXT_OPACITY = 0.67;\n/**\n * @internal\n */ export const legendClassNames = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea',\n legendContainer: 'fui-legend__legendContainer',\n annotation: 'fui-legend__annotation'\n};\nconst useStyles = makeStyles({\n root: {\n // FIXME: Removing this style allows the legend container in responsive donut chart to resize\n // properly (horizontally) within a flexbox or grid layout. But it causes vertical resizing issues\n // in responsive charts where legends consist of multiple words.\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center'\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n border: 'none',\n padding: `${LEGEND_PADDING}px`,\n textTransform: 'capitalize',\n // The default min-width is 64px. Setting it to 0 allows the legend container in responsive\n // cartesian charts to resize properly within a flexbox or grid layout.\n minWidth: 0,\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none',\n '&:focus-visible': {\n outline: `${tokens.strokeWidthThick} solid canvasText`,\n outlineOffset: `calc(${tokens.strokeWidthThick} * -1)`\n }\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none'\n }\n }\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)'\n },\n width: `${LEGEND_SHAPE_SIZE_WITHOUT_BORDER}px`,\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n border: `${LEGEND_SHAPE_BORDER}px solid`\n },\n shape: {\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n borderLeft: '6px solid transparent',\n borderRight: '6px solid transparent',\n borderTop: '10.4px solid',\n marginRight: tokens.spacingHorizontalS\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto'\n },\n // TO DO Add props when these styles are used in the component\n hoverChange: {\n width: '12px',\n height: '12px',\n marginRight: tokens.spacingHorizontalS,\n border: '1px solid'\n },\n resizableArea: {\n position: 'relative',\n textAlign: 'left',\n transform: 'translate(-50%, 0)',\n top: 'auto',\n left: '50%',\n minWidth: '200px',\n maxWidth: '800px',\n '::after': {\n padding: '1px 4px 1px',\n borderTop: '-2px',\n borderLeft: '-2px'\n }\n },\n legendContainer: {\n flex: '0 1 auto',\n margin: '4px'\n },\n annotation: {\n display: 'flex',\n alignItems: 'center',\n gap: '4px'\n }\n});\nexport const useLegendStyles = (props)=>{\n var _props_styles, _props_styles1, _props_styles2, _props_styles3, _props_styles4, _props_styles5, _props_styles6, _props_styles7, _props_styles8, _props_styles9;\n const { className } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n return {\n root: mergeClasses(legendClassNames.root, baseStyles.root, className, (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.root),\n legend: mergeClasses(legendClassNames.legend, baseStyles.legend, (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.legend),\n rect: mergeClasses(legendClassNames.rect, baseStyles.rect, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.rect),\n shape: mergeClasses(legendClassNames.shape, baseStyles.shape, (_props_styles3 = props.styles) === null || _props_styles3 === void 0 ? void 0 : _props_styles3.shape),\n triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, (_props_styles4 = props.styles) === null || _props_styles4 === void 0 ? void 0 : _props_styles4.triangle),\n text: mergeClasses(legendClassNames.text, baseStyles.text, (_props_styles5 = props.styles) === null || _props_styles5 === void 0 ? void 0 : _props_styles5.text),\n hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, (_props_styles6 = props.styles) === null || _props_styles6 === void 0 ? void 0 : _props_styles6.hoverChange),\n resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, (_props_styles7 = props.styles) === null || _props_styles7 === void 0 ? void 0 : _props_styles7.resizableArea),\n legendContainer: mergeClasses(legendClassNames.legendContainer, baseStyles.legendContainer, (_props_styles8 = props.styles) === null || _props_styles8 === void 0 ? void 0 : _props_styles8.legendContainer),\n annotation: mergeClasses(legendClassNames.annotation, baseStyles.annotation, (_props_styles9 = props.styles) === null || _props_styles9 === void 0 ? void 0 : _props_styles9.annotation)\n };\n};\n"],"names":["__styles","mergeClasses","tokens","typographyStyles","HighContrastSelector","LEGEND_CONTAINER_MARGIN_TOP","LEGEND_CONTAINER_MARGIN_START","LEGEND_PADDING","LEGEND_HEIGHT","LEGEND_SHAPE_BORDER","LEGEND_SHAPE_SIZE_WITHOUT_BORDER","LEGEND_SHAPE_SIZE","LEGEND_SHAPE_MARGIN_END","INACTIVE_LEGEND_TEXT_OPACITY","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","legendContainer","annotation","useStyles","Huce71","a9b677","Bt984gj","Brf1p80","Bceei9c","Bgfg5da","B9xav0g","oivjwe","Bn0qgzm","B4g9neb","zhjwy3","wvpqe5","ibv6hh","u1mtju","h3c5rm","vrafjx","Bekrc4i","i8vvqc","g2u3we","icvyot","B4j52fo","irswps","Byoj8tv","uwmqm3","z189sj","z8tnut","B0ocmuz","B9bfxx9","Bf4jedk","ixv5ic","Bkoo3cm","F23esa","Icej2d","B9gsw3i","swriq4","awn1t","Blj5yig","Fdtwhm","Blctwrt","Bh9kdj0","t21cq0","Bqenvij","Bahqtrf","Be2twd7","Bhrd7zp","Bg96gwp","sj55zd","Bvjb7m6","qhf8xq","fsow6f","Bz10aip","Bhzewxz","oyh7mz","B2u0y6b","B4uzyy","Be2s5ez","u6pn5x","smv486","B1nu0jp","B0n5ga8","Bm2nyyq","xrcqlc","wywymt","Gp14am","vfts7","Bhxzhr1","Du69r6","xawz","Bh6795r","Bnnss6s","fkmc3a","jrapky","Frg6f3","B6of3ja","B74szlk","mc9l5x","i8kkvl","Belr9w4","rmohyg","d","p","m","useLegendStyles","props","_props_styles","_props_styles1","_props_styles2","_props_styles3","_props_styles4","_props_styles5","_props_styles6","_props_styles7","_props_styles8","_props_styles9","className","baseStyles","styles"],"mappings":"AAAA,YAAY;;;;;;;;;;;;QAgBCa,4BAA4B;;;QAV5BP,6BAA6B;;;QAD7BD,2BAA2B;;;;eAG3BG,aAAa;;;;;QACbC,mBAAmB;;;;;;;;;;eAUfK,gBAAgB;;QA0GpB8F,eAAe;;;;uBA5Ha,gBAAgB;AAIlD,oCAAoC,CAAC;AACrC,sCAAsC,EAAE;AACxC,MAAMrG,cAAc,GAAG,CAAC;AACxB,sBAAsB,EAAE;AACxB,4BAA4B,CAAC;AACpC,MAAMG,gCAAgC,GAAG,EAAE;AAIpC,MAAMC,iBAAiB,GAAGD,gCAAgC,GAAGD,mBAAmB;AAChF,MAAMG,uBAAuB,GAAG,CAAC;AACjC,qCAAqC,IAAI;AAGrC,yBAAyB;IAChCG,IAAI,EAAE,kBAAkB;IACxBC,MAAM,EAAE,oBAAoB;IAC5BC,IAAI,EAAE,kBAAkB;IACxBC,KAAK,EAAE,mBAAmB;IAC1BC,QAAQ,EAAE,sBAAsB;IAChCC,IAAI,EAAE,kBAAkB;IACxBC,WAAW,EAAE,yBAAyB;IACtCC,aAAa,EAAE,2BAA2B;IAC1CC,eAAe,EAAE,6BAA6B;IAC9CC,UAAU,EAAE;AAChB,CAAC;AACD,MAAMC,SAAS,GAAA,WAAA,OAAGzB,eAAA,EAAA;IAAAe,IAAA,EAAA;QAAAW,MAAA,EAAA;QAAAC,MAAA,EAAA;QAAAC,OAAA,EAAA;IAAA;IAAAZ,MAAA,EAAA;QAAAY,OAAA,EAAA;QAAAC,OAAA,EAAA;YAAA;YAAA;SAAA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IAAI,IAAIP,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,IAAI,CAAC;QAChKC,WAAW,MAAEpB,mBAAY,EAACa,gBAAgB,CAACO,WAAW,EAAEoG,UAAU,CAACpG,WAAW,EAAE,CAAC+F,cAAc,GAAGP,KAAK,CAACa,MAAAA,AAAM,MAAM,IAAI,IAAIN,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,WAAW,CAAC;QAC5LC,aAAa,MAAErB,mBAAY,EAACa,gBAAgB,CAACQ,aAAa,EAAEmG,UAAU,CAACnG,aAAa,EAAE,CAAC+F,cAAc,GAAGR,KAAK,CAACa,MAAAA,AAAM,MAAM,IAAI,IAAIL,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,aAAa,CAAC;QACpMC,eAAe,MAAEtB,mBAAY,EAACa,gBAAgB,CAACS,eAAe,EAAEkG,UAAU,CAAClG,eAAe,EAAE,CAAC+F,cAAc,GAAGT,KAAK,CAACa,MAAAA,AAAM,MAAM,IAAI,IAAIJ,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,eAAe,CAAC;QAC5MC,UAAU,MAAEvB,mBAAY,EAACa,gBAAgB,CAACU,UAAU,EAAEiG,UAAU,CAACjG,UAAU,EAAE,CAAC+F,cAAc,GAAGV,KAAK,CAACa,MAAAA,AAAM,MAAM,IAAI,IAAIH,cAAc,KAAK,KAAK,CAAC,GAAG,KAAK,CAAC,GAAGA,cAAc,CAAC/F,UAAU;IAC3L,CAAC;AACL,CAAC"}
|
|
@@ -6,38 +6,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
function _export(target, all) {
|
|
7
7
|
for(var name in all)Object.defineProperty(target, name, {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: all
|
|
9
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
10
10
|
});
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
|
-
INACTIVE_LEGEND_TEXT_OPACITY
|
|
13
|
+
get INACTIVE_LEGEND_TEXT_OPACITY () {
|
|
14
14
|
return INACTIVE_LEGEND_TEXT_OPACITY;
|
|
15
15
|
},
|
|
16
|
-
LEGEND_CONTAINER_MARGIN_START
|
|
16
|
+
get LEGEND_CONTAINER_MARGIN_START () {
|
|
17
17
|
return LEGEND_CONTAINER_MARGIN_START;
|
|
18
18
|
},
|
|
19
|
-
LEGEND_CONTAINER_MARGIN_TOP
|
|
19
|
+
get LEGEND_CONTAINER_MARGIN_TOP () {
|
|
20
20
|
return LEGEND_CONTAINER_MARGIN_TOP;
|
|
21
21
|
},
|
|
22
|
-
LEGEND_HEIGHT
|
|
22
|
+
get LEGEND_HEIGHT () {
|
|
23
23
|
return LEGEND_HEIGHT;
|
|
24
24
|
},
|
|
25
|
-
LEGEND_PADDING
|
|
25
|
+
get LEGEND_PADDING () {
|
|
26
26
|
return LEGEND_PADDING;
|
|
27
27
|
},
|
|
28
|
-
LEGEND_SHAPE_BORDER
|
|
28
|
+
get LEGEND_SHAPE_BORDER () {
|
|
29
29
|
return LEGEND_SHAPE_BORDER;
|
|
30
30
|
},
|
|
31
|
-
LEGEND_SHAPE_MARGIN_END
|
|
31
|
+
get LEGEND_SHAPE_MARGIN_END () {
|
|
32
32
|
return LEGEND_SHAPE_MARGIN_END;
|
|
33
33
|
},
|
|
34
|
-
LEGEND_SHAPE_SIZE
|
|
34
|
+
get LEGEND_SHAPE_SIZE () {
|
|
35
35
|
return LEGEND_SHAPE_SIZE;
|
|
36
36
|
},
|
|
37
|
-
legendClassNames
|
|
37
|
+
get legendClassNames () {
|
|
38
38
|
return legendClassNames;
|
|
39
39
|
},
|
|
40
|
-
useLegendStyles
|
|
40
|
+
get useLegendStyles () {
|
|
41
41
|
return useLegendStyles;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/components/Legends/useLegendsStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { LegendsProps, LegendsStyles } from './Legends.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n\n// Constants needed to create legends using SVG for image export\nexport const LEGEND_CONTAINER_MARGIN_TOP = 8;\nexport const LEGEND_CONTAINER_MARGIN_START = 12;\nexport const LEGEND_PADDING = 8;\nexport const LEGEND_HEIGHT = 32;\nexport const LEGEND_SHAPE_BORDER = 1;\nconst LEGEND_SHAPE_SIZE_WITHOUT_BORDER = 12;\n// SVG strokes are drawn centered around the path, with half of the stroke width extending inward\n// (overlapping the fill area) and half outward. To ensure the filled area maintains its intended size,\n// expand the shape accordingly.\nexport const LEGEND_SHAPE_SIZE = LEGEND_SHAPE_SIZE_WITHOUT_BORDER + LEGEND_SHAPE_BORDER;\nexport const LEGEND_SHAPE_MARGIN_END = 8;\nexport const INACTIVE_LEGEND_TEXT_OPACITY = 0.67;\n\n/**\n * @internal\n */\nexport const legendClassNames: SlotClassNames<LegendsStyles> = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea',\n legendContainer: 'fui-legend__legendContainer',\n annotation: 'fui-legend__annotation',\n};\n\nconst useStyles = makeStyles({\n root: {\n // FIXME: Removing this style allows the legend container in responsive donut chart to resize\n // properly (horizontally) within a flexbox or grid layout. But it causes vertical resizing issues\n // in responsive charts where legends consist of multiple words.\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n border: 'none',\n padding: `${LEGEND_PADDING}px`,\n textTransform: 'capitalize',\n // The default min-width is 64px. Setting it to 0 allows the legend container in responsive\n // cartesian charts to resize properly within a flexbox or grid layout.\n minWidth: 0,\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none',\n '&:focus-visible': {\n outline: `${tokens.strokeWidthThick} solid canvasText`,\n outlineOffset: `calc(${tokens.strokeWidthThick} * -1)`,\n },\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n },\n },\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)',\n },\n width: `${LEGEND_SHAPE_SIZE_WITHOUT_BORDER}px`,\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n border: `${LEGEND_SHAPE_BORDER}px solid`,\n },\n shape: {\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n borderLeft: '6px solid transparent',\n borderRight: '6px solid transparent',\n borderTop: '10.4px solid',\n marginRight: tokens.spacingHorizontalS,\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n // TO DO Add props when these styles are used in the component\n hoverChange: {\n width: '12px',\n height: '12px',\n marginRight: tokens.spacingHorizontalS,\n border: '1px solid',\n },\n resizableArea: {\n position: 'relative',\n textAlign: 'left',\n transform: 'translate(-50%, 0)',\n top: 'auto',\n left: '50%',\n minWidth: '200px',\n maxWidth: '800px',\n '::after': {\n padding: '1px 4px 1px',\n borderTop: '-2px',\n borderLeft: '-2px',\n },\n },\n legendContainer: {\n flex: '0 1 auto',\n margin: '4px',\n },\n annotation: {\n display: 'flex',\n alignItems: 'center',\n gap: '4px',\n },\n});\n\nexport const useLegendStyles = (props: LegendsProps): LegendsStyles => {\n const { className } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(legendClassNames.root, baseStyles.root, className, props.styles?.root),\n legend: mergeClasses(legendClassNames.legend, baseStyles.legend, props.styles?.legend),\n rect: mergeClasses(legendClassNames.rect, baseStyles.rect, props.styles?.rect),\n shape: mergeClasses(legendClassNames.shape, baseStyles.shape, props.styles?.shape),\n triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, props.styles?.triangle),\n text: mergeClasses(legendClassNames.text, baseStyles.text, props.styles?.text),\n hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, props.styles?.hoverChange),\n resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, props.styles?.resizableArea),\n legendContainer: mergeClasses(\n legendClassNames.legendContainer,\n baseStyles.legendContainer,\n props.styles?.legendContainer,\n ),\n annotation: mergeClasses(legendClassNames.annotation, baseStyles.annotation, props.styles?.annotation),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","HighContrastSelector","LEGEND_CONTAINER_MARGIN_TOP","LEGEND_CONTAINER_MARGIN_START","LEGEND_PADDING","LEGEND_HEIGHT","LEGEND_SHAPE_BORDER","LEGEND_SHAPE_SIZE_WITHOUT_BORDER","LEGEND_SHAPE_SIZE","LEGEND_SHAPE_MARGIN_END","INACTIVE_LEGEND_TEXT_OPACITY","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","legendContainer","annotation","useStyles","whiteSpace","width","alignItems","justifyContent","cursor","border","padding","textTransform","minWidth","color","forcedColorAdjust","outline","strokeWidthThick","outlineOffset","content","opacity","marginRight","height","borderLeft","borderRight","borderTop","spacingHorizontalS","caption1","colorNeutralForeground1","position","textAlign","transform","top","left","maxWidth","flex","margin","display","gap","useLegendStyles","props","className","baseStyles","styles"],"mappings":"AAAA;;;;;;;;;;;;IAoBaa,4BAAAA;;;iCAVAP;eAAAA;;+BADAD;;;iBAGAG;;;kBADAD;;;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AAA,KAAAA,IAAAA,eAAcvC,aAAa;QACjHC,qBAAiBtB,mBAAAA,EACfa,iBAAiBS,eAAe,EAChCwC,WAAWxC,eAAe,EAAA,CAC1BsC,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAActC,eAAe;QAE/BC,gBAAYvB,mBAAAA,EAAaa,iBAAiBU,UAAU,EAAEuC,WAAWvC,UAAU,EAAA,CAAEqC,iBAAAA,MAAMG,MAAAA,AAAM,MAAA,QAAZH,mBAAAA,KAAAA,IAAAA,KAAAA,IAAAA,eAAcrC,UAAU;IACvG;AACF,EAAE"}
|
|
1
|
+
{"version":3,"sources":["../../../src/components/Legends/useLegendsStyles.styles.ts"],"sourcesContent":["'use client';\n\nimport { makeStyles, mergeClasses } from '@griffel/react';\nimport type { SlotClassNames } from '@fluentui/react-utilities';\nimport type { LegendsProps, LegendsStyles } from './Legends.types';\nimport { tokens, typographyStyles } from '@fluentui/react-theme';\nimport { HighContrastSelector } from '../../utilities/index';\n\n// Constants needed to create legends using SVG for image export\nexport const LEGEND_CONTAINER_MARGIN_TOP = 8;\nexport const LEGEND_CONTAINER_MARGIN_START = 12;\nexport const LEGEND_PADDING = 8;\nexport const LEGEND_HEIGHT = 32;\nexport const LEGEND_SHAPE_BORDER = 1;\nconst LEGEND_SHAPE_SIZE_WITHOUT_BORDER = 12;\n// SVG strokes are drawn centered around the path, with half of the stroke width extending inward\n// (overlapping the fill area) and half outward. To ensure the filled area maintains its intended size,\n// expand the shape accordingly.\nexport const LEGEND_SHAPE_SIZE = LEGEND_SHAPE_SIZE_WITHOUT_BORDER + LEGEND_SHAPE_BORDER;\nexport const LEGEND_SHAPE_MARGIN_END = 8;\nexport const INACTIVE_LEGEND_TEXT_OPACITY = 0.67;\n\n/**\n * @internal\n */\nexport const legendClassNames: SlotClassNames<LegendsStyles> = {\n root: 'fui-legend__root',\n legend: 'fui-legend__legend',\n rect: 'fui-legend__rect',\n shape: 'fui-legend__shape',\n triangle: 'fui-legend__triangle',\n text: 'fui-legend__text',\n hoverChange: 'fui-legend__hoverChange',\n resizableArea: 'fui-legend__resizableArea',\n legendContainer: 'fui-legend__legendContainer',\n annotation: 'fui-legend__annotation',\n};\n\nconst useStyles = makeStyles({\n root: {\n // FIXME: Removing this style allows the legend container in responsive donut chart to resize\n // properly (horizontally) within a flexbox or grid layout. But it causes vertical resizing issues\n // in responsive charts where legends consist of multiple words.\n whiteSpace: 'nowrap',\n width: '100%',\n alignItems: 'center',\n },\n legend: {\n // setting display to flex does not work\n // display: 'flex',\n alignItems: 'center',\n justifyContent: 'left',\n cursor: 'pointer',\n border: 'none',\n padding: `${LEGEND_PADDING}px`,\n textTransform: 'capitalize',\n // The default min-width is 64px. Setting it to 0 allows the legend container in responsive\n // cartesian charts to resize properly within a flexbox or grid layout.\n minWidth: 0,\n [HighContrastSelector]: {\n color: 'WindowText',\n forcedColorAdjust: 'none',\n '&:focus-visible': {\n outline: `${tokens.strokeWidthThick} solid canvasText`,\n outlineOffset: `calc(${tokens.strokeWidthThick} * -1)`,\n },\n },\n '&:hover': {\n [HighContrastSelector]: {\n color: 'HighlightText',\n forcedColorAdjust: 'none',\n },\n },\n },\n rect: {\n [HighContrastSelector]: {\n content: 'var(--rect-content-high-contrast)',\n opacity: 'var(--rect-opacity-high-contrast)',\n },\n width: `${LEGEND_SHAPE_SIZE_WITHOUT_BORDER}px`,\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n border: `${LEGEND_SHAPE_BORDER}px solid`,\n },\n shape: {\n marginRight: `${LEGEND_SHAPE_MARGIN_END}px`,\n },\n // TO DO Add props when these styles are used in the component\n triangle: {\n width: '0',\n height: '0',\n borderLeft: '6px solid transparent',\n borderRight: '6px solid transparent',\n borderTop: '10.4px solid',\n marginRight: tokens.spacingHorizontalS,\n },\n // TO DO Add props when these styles are used in the component\n text: {\n ...typographyStyles.caption1,\n color: tokens.colorNeutralForeground1,\n forcedColorAdjust: 'auto',\n },\n // TO DO Add props when these styles are used in the component\n hoverChange: {\n width: '12px',\n height: '12px',\n marginRight: tokens.spacingHorizontalS,\n border: '1px solid',\n },\n resizableArea: {\n position: 'relative',\n textAlign: 'left',\n transform: 'translate(-50%, 0)',\n top: 'auto',\n left: '50%',\n minWidth: '200px',\n maxWidth: '800px',\n '::after': {\n padding: '1px 4px 1px',\n borderTop: '-2px',\n borderLeft: '-2px',\n },\n },\n legendContainer: {\n flex: '0 1 auto',\n margin: '4px',\n },\n annotation: {\n display: 'flex',\n alignItems: 'center',\n gap: '4px',\n },\n});\n\nexport const useLegendStyles = (props: LegendsProps): LegendsStyles => {\n const { className } = props; // ToDo - width, barHeight is non enumerable. Need to be used inline.\n const baseStyles = useStyles();\n\n return {\n root: mergeClasses(legendClassNames.root, baseStyles.root, className, props.styles?.root),\n legend: mergeClasses(legendClassNames.legend, baseStyles.legend, props.styles?.legend),\n rect: mergeClasses(legendClassNames.rect, baseStyles.rect, props.styles?.rect),\n shape: mergeClasses(legendClassNames.shape, baseStyles.shape, props.styles?.shape),\n triangle: mergeClasses(legendClassNames.triangle, baseStyles.triangle, props.styles?.triangle),\n text: mergeClasses(legendClassNames.text, baseStyles.text, props.styles?.text),\n hoverChange: mergeClasses(legendClassNames.hoverChange, baseStyles.hoverChange, props.styles?.hoverChange),\n resizableArea: mergeClasses(legendClassNames.resizableArea, baseStyles.resizableArea, props.styles?.resizableArea),\n legendContainer: mergeClasses(\n legendClassNames.legendContainer,\n baseStyles.legendContainer,\n props.styles?.legendContainer,\n ),\n annotation: mergeClasses(legendClassNames.annotation, baseStyles.annotation, props.styles?.annotation),\n };\n};\n"],"names":["makeStyles","mergeClasses","tokens","typographyStyles","HighContrastSelector","LEGEND_CONTAINER_MARGIN_TOP","LEGEND_CONTAINER_MARGIN_START","LEGEND_PADDING","LEGEND_HEIGHT","LEGEND_SHAPE_BORDER","LEGEND_SHAPE_SIZE_WITHOUT_BORDER","LEGEND_SHAPE_SIZE","LEGEND_SHAPE_MARGIN_END","INACTIVE_LEGEND_TEXT_OPACITY","legendClassNames","root","legend","rect","shape","triangle","text","hoverChange","resizableArea","legendContainer","annotation","useStyles","whiteSpace","width","alignItems","justifyContent","cursor","border","padding","textTransform","minWidth","color","forcedColorAdjust","outline","strokeWidthThick","outlineOffset","content","opacity","marginRight","height","borderLeft","borderRight","borderTop","spacingHorizontalS","caption1","colorNeutralForeground1","position","textAlign","transform","top","left","maxWidth","flex","margin","display","gap","useLegendStyles","props","className","baseStyles","styles"],"mappings":"AAAA;;;;;;;;;;;;QAoBaa;;;QAVAP;;;;;;QAEAE;;;;;;;;;;;;;;;;eAaAM;;;eA4GA8C;;;uBAnI4B,iBAAiB;4BAGjB,wBAAwB;uBAC5B,2BAAwB;AAGtD,MAAMvD,8BAA8B,EAAE;AACtC,sCAAsC,GAAG;AACzC,MAAME,iBAAiB,EAAE;AACzB,sBAAsB,GAAG;AACzB,MAAME,sBAAsB,EAAE;AACrC,MAAMC,mCAAmC;AAIlC,MAAMC,oBAAoBD,mCAAmCD,oBAAoB;AACjF,MAAMG,0BAA0B,EAAE;AAClC,qCAAqC,KAAK;AAK1C,yBAAwD;IAC7DG,MAAM;IACNC,QAAQ;IACRC,MAAM;IACNC,OAAO;IACPC,UAAU;IACVC,MAAM;IACNC,aAAa;IACbC,eAAe;IACfC,iBAAiB;IACjBC,YAAY;AACd,EAAE;AAEF,MAAMC,gBAAYzB,iBAAAA,EAAW;IAC3Be,MAAM;QACJ,6FAA6F;QAC7F,kGAAkG;QAClG,gEAAgE;QAChEW,YAAY;QACZC,OAAO;QACPC,YAAY;IACd;IACAZ,QAAQ;QACN,wCAAwC;QACxC,mBAAmB;QACnBY,YAAY;QACZC,gBAAgB;QAChBC,QAAQ;QACRC,QAAQ;QACRC,SAAS,GAAGzB,eAAe,EAAE,CAAC;QAC9B0B,eAAe;QACf,2FAA2F;QAC3F,uEAAuE;QACvEC,UAAU;QACV,CAAC9B,2BAAAA,CAAqB,EAAE;YACtB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