@gooddata/sdk-ui-geo 11.23.0-alpha.4 → 11.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm/next/components/RenderGeoChart.d.ts.map +1 -1
- package/esm/next/components/RenderGeoChart.js +23 -2
- package/esm/next/components/RenderGeoChart.js.map +1 -1
- package/esm/next/components/multiLayerLegend/GeoChartLegendOverlay.d.ts +4 -1
- package/esm/next/components/multiLayerLegend/GeoChartLegendOverlay.d.ts.map +1 -1
- package/esm/next/components/multiLayerLegend/GeoChartLegendOverlay.js +3 -2
- package/esm/next/components/multiLayerLegend/GeoChartLegendOverlay.js.map +1 -1
- package/esm/next/components/multiLayerLegend/LayerToggleSwitch.d.ts.map +1 -1
- package/esm/next/components/multiLayerLegend/LayerToggleSwitch.js +2 -8
- package/esm/next/components/multiLayerLegend/LayerToggleSwitch.js.map +1 -1
- package/esm/next/components/multiLayerLegend/LegendGroupColor.d.ts +4 -10
- package/esm/next/components/multiLayerLegend/LegendGroupColor.d.ts.map +1 -1
- package/esm/next/components/multiLayerLegend/LegendGroupColor.js +83 -8
- package/esm/next/components/multiLayerLegend/LegendGroupColor.js.map +1 -1
- package/esm/next/components/multiLayerLegend/LegendGroupColorScale.d.ts +13 -0
- package/esm/next/components/multiLayerLegend/LegendGroupColorScale.d.ts.map +1 -1
- package/esm/next/components/multiLayerLegend/LegendGroupColorScale.js +13 -5
- package/esm/next/components/multiLayerLegend/LegendGroupColorScale.js.map +1 -1
- package/esm/next/components/multiLayerLegend/LegendGroupContainer.d.ts +16 -0
- package/esm/next/components/multiLayerLegend/LegendGroupContainer.d.ts.map +1 -0
- package/esm/next/components/multiLayerLegend/LegendGroupContainer.js +16 -0
- package/esm/next/components/multiLayerLegend/LegendGroupContainer.js.map +1 -0
- package/esm/next/components/multiLayerLegend/LegendGroupSize.d.ts +8 -0
- package/esm/next/components/multiLayerLegend/LegendGroupSize.d.ts.map +1 -1
- package/esm/next/components/multiLayerLegend/LegendGroupSize.js +18 -9
- package/esm/next/components/multiLayerLegend/LegendGroupSize.js.map +1 -1
- package/esm/next/components/multiLayerLegend/MultiLayerLegendPanel.d.ts +13 -0
- package/esm/next/components/multiLayerLegend/MultiLayerLegendPanel.d.ts.map +1 -1
- package/esm/next/components/multiLayerLegend/MultiLayerLegendPanel.js +76 -11
- package/esm/next/components/multiLayerLegend/MultiLayerLegendPanel.js.map +1 -1
- package/esm/next/components/multiLayerLegend/MultiLayerLegendSection.d.ts +10 -1
- package/esm/next/components/multiLayerLegend/MultiLayerLegendSection.d.ts.map +1 -1
- package/esm/next/components/multiLayerLegend/MultiLayerLegendSection.js +38 -15
- package/esm/next/components/multiLayerLegend/MultiLayerLegendSection.js.map +1 -1
- package/esm/next/components/multiLayerLegend/legendMessages.d.ts +6 -0
- package/esm/next/components/multiLayerLegend/legendMessages.d.ts.map +1 -0
- package/esm/next/components/multiLayerLegend/legendMessages.js +20 -0
- package/esm/next/components/multiLayerLegend/legendMessages.js.map +1 -0
- package/esm/next/hooks/map/useMapInitialization.d.ts +5 -2
- package/esm/next/hooks/map/useMapInitialization.d.ts.map +1 -1
- package/esm/next/hooks/map/useMapInitialization.js +107 -4
- package/esm/next/hooks/map/useMapInitialization.js.map +1 -1
- package/esm/next/hooks/pushData/useGeoPushData.d.ts +2 -1
- package/esm/next/hooks/pushData/useGeoPushData.d.ts.map +1 -1
- package/esm/next/hooks/pushData/useGeoPushData.js +29 -3
- package/esm/next/hooks/pushData/useGeoPushData.js.map +1 -1
- package/esm/next/layers/common/computeLegend.d.ts.map +1 -1
- package/esm/next/layers/common/computeLegend.js +3 -3
- package/esm/next/layers/common/computeLegend.js.map +1 -1
- package/esm/next/layers/common/mapFacade.d.ts +5 -0
- package/esm/next/layers/common/mapFacade.d.ts.map +1 -1
- package/esm/next/layers/common/mapFacade.js +5 -0
- package/esm/next/layers/common/mapFacade.js.map +1 -1
- package/esm/next/map/MapController.d.ts +4 -1
- package/esm/next/map/MapController.d.ts.map +1 -1
- package/esm/next/map/MapController.js +2 -2
- package/esm/next/map/MapController.js.map +1 -1
- package/esm/next/map/runtime/mapConfig.d.ts +23 -0
- package/esm/next/map/runtime/mapConfig.d.ts.map +1 -1
- package/esm/next/map/runtime/mapConfig.js +24 -0
- package/esm/next/map/runtime/mapConfig.js.map +1 -1
- package/esm/next/map/runtime/mapInitialization.d.ts +8 -1
- package/esm/next/map/runtime/mapInitialization.d.ts.map +1 -1
- package/esm/next/map/runtime/mapInitialization.js +9 -3
- package/esm/next/map/runtime/mapInitialization.js.map +1 -1
- package/esm/next/types/config/areaChart.d.ts +13 -0
- package/esm/next/types/config/areaChart.d.ts.map +1 -1
- package/esm/next/types/config/pushpinChart.d.ts +13 -0
- package/esm/next/types/config/pushpinChart.d.ts.map +1 -1
- package/esm/next/types/config/unified.d.ts +13 -0
- package/esm/next/types/config/unified.d.ts.map +1 -1
- package/esm/next/utils/alphabeticalSorting.d.ts +13 -0
- package/esm/next/utils/alphabeticalSorting.d.ts.map +1 -0
- package/esm/next/utils/alphabeticalSorting.js +22 -0
- package/esm/next/utils/alphabeticalSorting.js.map +1 -0
- package/esm/next/utils/mapCanvasAccessibility.d.ts +31 -0
- package/esm/next/utils/mapCanvasAccessibility.d.ts.map +1 -0
- package/esm/next/utils/mapCanvasAccessibility.js +60 -0
- package/esm/next/utils/mapCanvasAccessibility.js.map +1 -0
- package/esm/sdk-ui-geo.d.ts +39 -0
- package/package.json +11 -11
- package/styles/css/main.css +75 -5
- package/styles/css/main.css.map +1 -1
- package/styles/scss/_geo-multi-layer-legend.scss +91 -4
- package/styles/scss/geo-chart-next.scss +5 -0
- package/styles/scss/main.scss +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderGeoChart.d.ts","sourceRoot":"","sources":["../../../src/next/components/RenderGeoChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,
|
|
1
|
+
{"version":3,"file":"RenderGeoChart.d.ts","sourceRoot":"","sources":["../../../src/next/components/RenderGeoChart.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAA0C,MAAM,OAAO,CAAC;AAiClF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,cAAc,IAAI,YAAY,CAiH7C"}
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
|
-
import { useMemo, useRef, useState } from "react";
|
|
3
|
+
import { useCallback, useMemo, useRef, useState } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
import { defaultImport } from "default-import";
|
|
6
|
+
import { useIntl } from "react-intl";
|
|
6
7
|
import ReactMeasure from "react-measure";
|
|
7
8
|
import { v4 } from "uuid";
|
|
8
9
|
import { IntlTranslationsProvider, convertDrillableItemsToPredicates, } from "@gooddata/sdk-ui";
|
|
9
10
|
import { GeoChartLegendOverlay } from "./multiLayerLegend/GeoChartLegendOverlay.js";
|
|
11
|
+
import { legendMessagesById } from "./multiLayerLegend/legendMessages.js";
|
|
10
12
|
import { useGeoChartProps } from "../context/GeoChartContext.js";
|
|
11
13
|
import { useGeoLayers } from "../context/GeoLayersContext.js";
|
|
12
14
|
import { MapController } from "../map/MapController.js";
|
|
13
15
|
import { computeViewportFromConfig } from "../map/viewport/viewportResolution.js";
|
|
14
16
|
import { computeCombinedViewport } from "../map/viewport.js";
|
|
15
17
|
import { PushDataSync } from "../pushData/PushDataSync.js";
|
|
18
|
+
import { getMapCanvasInstructionMessageId, getMapCanvasRuntimeCapabilities, mapCanvasInstructionMessagesById, } from "../utils/mapCanvasAccessibility.js";
|
|
16
19
|
// There are known compatibility issues between CommonJS (CJS) and ECMAScript modules (ESM).
|
|
17
20
|
const Measure = defaultImport(ReactMeasure);
|
|
18
21
|
const containerBaseId = "geo-chart-next";
|
|
@@ -33,9 +36,25 @@ const containerBaseId = "geo-chart-next";
|
|
|
33
36
|
*/
|
|
34
37
|
export function RenderGeoChart() {
|
|
35
38
|
const props = useGeoChartProps();
|
|
39
|
+
const intl = useIntl();
|
|
36
40
|
const { layers, layerExecutions, primaryLayer } = useGeoLayers();
|
|
37
41
|
const mapContainerRef = useRef(null);
|
|
42
|
+
const legendPanelRef = useRef(null);
|
|
38
43
|
const containerId = useMemo(() => `${containerBaseId}-${v4()}`, []);
|
|
44
|
+
const isGeoChartA11yImprovementsEnabled = props.config?.enableGeoChartA11yImprovements ?? false;
|
|
45
|
+
const mapInstructionsId = useMemo(() => (isGeoChartA11yImprovementsEnabled ? `${containerBaseId}-instructions-${v4()}` : undefined), [isGeoChartA11yImprovementsEnabled]);
|
|
46
|
+
const mapCanvasCapabilities = useMemo(() => (isGeoChartA11yImprovementsEnabled ? getMapCanvasRuntimeCapabilities(props.config) : undefined), [isGeoChartA11yImprovementsEnabled, props.config]);
|
|
47
|
+
const instructionMessage = useMemo(() => {
|
|
48
|
+
if (!mapCanvasCapabilities) {
|
|
49
|
+
return "";
|
|
50
|
+
}
|
|
51
|
+
const instructionMessageId = getMapCanvasInstructionMessageId(mapCanvasCapabilities);
|
|
52
|
+
return intl.formatMessage(mapCanvasInstructionMessagesById[instructionMessageId]);
|
|
53
|
+
}, [mapCanvasCapabilities, intl]);
|
|
54
|
+
const mapCanvasTitle = isGeoChartA11yImprovementsEnabled ? props.config?.a11yTitle : undefined;
|
|
55
|
+
const legendMessageFormatter = useCallback((id, values) => {
|
|
56
|
+
return intl.formatMessage(legendMessagesById[id], values);
|
|
57
|
+
}, [intl]);
|
|
39
58
|
const [chartContainerRect, setChartContainerRect] = useState(null);
|
|
40
59
|
const availableLegends = primaryLayer?.availableLegends;
|
|
41
60
|
const dataViewport = useMemo(() => computeCombinedViewport(layers), [layers]);
|
|
@@ -46,7 +65,9 @@ export function RenderGeoChart() {
|
|
|
46
65
|
isExportMode,
|
|
47
66
|
});
|
|
48
67
|
return (_jsx(Measure, { client: true, onResize: setChartContainerRect, children: ({ measureRef }) => (_jsxs("div", { id: containerId, "data-testid": isExportMode ? "geo-chart-next-export-mode" : containerBaseId, className: containerClass, ref: measureRef, children: [
|
|
49
|
-
_jsx("div", { ref: mapContainerRef, className: "gd-geo-chart-next__map", children: _jsx(IntlTranslationsProvider, { children: (translationProps) => (_jsx(GeoChartLegendOverlay, { config: props.config, chartContainerRect: chartContainerRect, layers: layers, layerExecutions: layerExecutions, primaryLayer: primaryLayer, numericSymbols: translationProps.numericSymbols
|
|
68
|
+
_jsx("div", { ref: mapContainerRef, className: "gd-geo-chart-next__map", children: _jsx(IntlTranslationsProvider, { children: (translationProps) => (_jsx(GeoChartLegendOverlay, { config: props.config, chartContainerRect: chartContainerRect, layers: layers, layerExecutions: layerExecutions, primaryLayer: primaryLayer, numericSymbols: translationProps.numericSymbols, formatMessage: legendMessageFormatter, setLegendPanelElementRef: (element) => {
|
|
69
|
+
legendPanelRef.current = element;
|
|
70
|
+
} })) }) }), isGeoChartA11yImprovementsEnabled && mapInstructionsId ? (_jsx("p", { id: mapInstructionsId, className: "sr-only", children: instructionMessage })) : null, _jsx(MapController, { mapContainerRef: mapContainerRef, chartContainerRect: chartContainerRect, initialViewport: initialViewport, dataViewport: dataViewport, layerExecutions: layerExecutions, drillablePredicates: drillablePredicates, onCenterPositionChanged: props.onCenterPositionChanged, onZoomChanged: props.onZoomChanged, onDrill: props.onDrill, afterRender: props.afterRender, config: props.config, backend: props.backend, mapInstructionsId: mapInstructionsId, mapCanvasTitle: mapCanvasTitle, legendPanelRef: legendPanelRef }), _jsx(PushDataSync, { availableLegends: availableLegends, geoLayerType: props.type })
|
|
50
71
|
] })) }));
|
|
51
72
|
}
|
|
52
73
|
//# sourceMappingURL=RenderGeoChart.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenderGeoChart.js","sourceRoot":"","sources":["../../../src/next/components/RenderGeoChart.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,OAAO,EA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,YAAY,EAAE,KAAK,CAAC,IAAI,GAAI;gBAC5E,CACT,GACK,CACb,CAAC;AAAA,CACL"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ReactElement } from "react";
|
|
2
2
|
import { type ContentRect } from "react-measure";
|
|
3
|
+
import { type LegendMessageFormatter } from "./legendMessages.js";
|
|
3
4
|
import type { IGeoLayerData } from "../../context/GeoLayersContext.js";
|
|
4
5
|
import type { IGeoChartConfig } from "../../types/config/unified.js";
|
|
5
6
|
import type { ILayerExecutionRecord } from "../../types/props/geoChart/internal.js";
|
|
@@ -19,11 +20,13 @@ export interface IGeoChartLegendOverlayProps {
|
|
|
19
20
|
layerExecutions: ILayerExecutionRecord[];
|
|
20
21
|
primaryLayer: IGeoLayerData | null;
|
|
21
22
|
numericSymbols?: string[];
|
|
23
|
+
formatMessage?: LegendMessageFormatter;
|
|
24
|
+
setLegendPanelElementRef?: (element: HTMLDivElement | null) => void;
|
|
22
25
|
}
|
|
23
26
|
/**
|
|
24
27
|
* Renders the multi-layer legend panel as a map overlay.
|
|
25
28
|
*
|
|
26
29
|
* @internal
|
|
27
30
|
*/
|
|
28
|
-
export declare function GeoChartLegendOverlay({ config, chartContainerRect, layers, layerExecutions, primaryLayer, numericSymbols }: IGeoChartLegendOverlayProps): ReactElement | null;
|
|
31
|
+
export declare function GeoChartLegendOverlay({ config, chartContainerRect, layers, layerExecutions, primaryLayer, numericSymbols, formatMessage, setLegendPanelElementRef }: IGeoChartLegendOverlayProps): ReactElement | null;
|
|
29
32
|
//# sourceMappingURL=GeoChartLegendOverlay.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoChartLegendOverlay.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/GeoChartLegendOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"GeoChartLegendOverlay.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/GeoChartLegendOverlay.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,OAAO,CAAC;AAEhE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAElE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAKvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAEpF;;;;;;;;GAQG;AACH,MAAM,WAAW,2BAA2B;IACxC,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC;IACpC,kBAAkB,EAAE,WAAW,GAAG,IAAI,CAAC;IACvC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACnC,eAAe,EAAE,qBAAqB,EAAE,CAAC;IACzC,YAAY,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,wBAAwB,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAC;CACvE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,EAClC,MAAM,EACN,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,wBAAwB,EAC3B,EAAE,2BAA2B,GAAG,YAAY,GAAG,IAAI,CAkDnD"}
|
|
@@ -11,7 +11,7 @@ import { useMultiLayerLegend } from "../../hooks/legend/useMultiLayerLegend.js";
|
|
|
11
11
|
*
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
|
-
export function GeoChartLegendOverlay({ config, chartContainerRect, layers, layerExecutions, primaryLayer, numericSymbols, }) {
|
|
14
|
+
export function GeoChartLegendOverlay({ config, chartContainerRect, layers, layerExecutions, primaryLayer, numericSymbols, formatMessage, setLegendPanelElementRef, }) {
|
|
15
15
|
const { toggleLegendItem, toggleLayerVisibility, hiddenLayers } = useGeoLegend();
|
|
16
16
|
const model = useMultiLayerLegend(layerExecutions, layers, { numericSymbols });
|
|
17
17
|
const legendConfig = useLegendConfig(config);
|
|
@@ -26,10 +26,11 @@ export function GeoChartLegendOverlay({ config, chartContainerRect, layers, laye
|
|
|
26
26
|
toggleLayerVisibility(layerId);
|
|
27
27
|
}, [toggleLayerVisibility]);
|
|
28
28
|
const enabled = useMemo(() => legendConfig.enabled, [legendConfig.enabled]);
|
|
29
|
+
const enableGeoChartA11yImprovements = config?.enableGeoChartA11yImprovements ?? false;
|
|
29
30
|
// Don't render until container is measured (needed for height calculations)
|
|
30
31
|
if (!chartContainerRect?.client?.height) {
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
|
-
return (_jsx(MultiLayerLegendPanel, { enabled: enabled, model: model, position: position, hiddenLayers: hiddenLayers, onLayerVisibilityChange: handleLayerVisibilityChange, onItemClick: handleLegendItemClick }));
|
|
34
|
+
return (_jsx(MultiLayerLegendPanel, { enabled: enabled, model: model, position: position, hiddenLayers: hiddenLayers, onLayerVisibilityChange: handleLayerVisibilityChange, onItemClick: handleLegendItemClick, enableGeoChartA11yImprovements: enableGeoChartA11yImprovements, formatMessage: formatMessage, setPanelElementRef: setLegendPanelElementRef }));
|
|
34
35
|
}
|
|
35
36
|
//# sourceMappingURL=GeoChartLegendOverlay.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GeoChartLegendOverlay.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/GeoChartLegendOverlay.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"GeoChartLegendOverlay.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/GeoChartLegendOverlay.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAKhE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wCAAwC,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AAwBhF;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAClC,MAAM,EACN,kBAAkB,EAClB,MAAM,EACN,eAAe,EACf,YAAY,EACZ,cAAc,EACd,aAAa,EACb,wBAAwB,GACE,EAAuB;IACjD,MAAM,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,YAAY,EAAE,GAAG,YAAY,EAAE,CAAC;IAEjF,MAAM,KAAK,GAAG,mBAAmB,CAAC,eAAe,EAAE,MAAM,EAAE,EAAE,cAAc,EAAE,CAAC,CAAC;IAE/E,MAAM,YAAY,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,aAAa,GAAG,gBAAgB,CAClC,MAAM,EACN,YAAY,EAAE,OAAO,IAAI,IAAI,EAC7B,kBAAkB,IAAI,SAAS,CAClC,CAAC;IACF,MAAM,QAAQ,GAAG,aAAa,EAAE,QAAQ,IAAI,YAAY,CAAC,QAAQ,CAAC;IAElE,MAAM,qBAAqB,GAAG,WAAW,CACrC,CAAC,OAAe,EAAE,GAAW,EAAE,EAAE,CAAC;QAC9B,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM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;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAErC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,+
|
|
1
|
+
{"version":3,"file":"LayerToggleSwitch.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LayerToggleSwitch.tsx"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,MAAM,WAAW,uBAAuB;IACpC;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;IAEjB;;OAEG;IACH,QAAQ,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IAErC;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,+DAkC5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
// (C) 2025 GoodData Corporation
|
|
2
|
+
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { memo } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
5
|
/**
|
|
@@ -17,17 +17,11 @@ export const LayerToggleSwitch = memo(function LayerToggleSwitch({ id, checked,
|
|
|
17
17
|
onChange(!checked);
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
const handleKeyDown = (event) => {
|
|
21
|
-
if (!disabled && (event.key === "Enter" || event.key === " ")) {
|
|
22
|
-
event.preventDefault();
|
|
23
|
-
onChange(!checked);
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
20
|
const toggleClassName = cx("gd-geo-legend-toggle", {
|
|
27
21
|
"gd-geo-legend-toggle--checked": checked,
|
|
28
22
|
"gd-geo-legend-toggle--disabled": disabled,
|
|
29
23
|
});
|
|
30
|
-
return (_jsxs("button", { type: "button", id: id, className: toggleClassName, role: "switch", "aria-checked": checked, "aria-label": ariaLabel, disabled: disabled, onClick: handleChange,
|
|
24
|
+
return (_jsxs("button", { type: "button", id: id, className: toggleClassName, role: "switch", "aria-checked": checked, "aria-label": ariaLabel, disabled: disabled, onClick: handleChange, "data-testid": `gd-geo-legend-toggle-${id}`, children: [
|
|
31
25
|
_jsx("span", { className: "gd-geo-legend-toggle__track" }), _jsx("span", { className: "gd-geo-legend-toggle__thumb" })
|
|
32
26
|
] }));
|
|
33
27
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayerToggleSwitch.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LayerToggleSwitch.tsx"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"LayerToggleSwitch.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LayerToggleSwitch.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,IAAI,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,MAAM,YAAY,CAAC;AAkC5B;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC,SAAS,iBAAiB,CAAC,EAC7D,EAAE,EACF,OAAO,EACP,QAAQ,EACR,SAAS,EACT,QAAQ,GAAG,KAAK,GACM,EAAgB;IACtC,MAAM,YAAY,GAAG,GAAG,EAAE,CAAC;QACvB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACZ,QAAQ,CAAC,CAAC,OAAO,CAAC,CAAC;QACvB,CAAC;IAAA,CACJ,CAAC;IAEF,MAAM,eAAe,GAAG,EAAE,CAAC,sBAAsB,EAAE;QAC/C,+BAA+B,EAAE,OAAO;QACxC,gCAAgC,EAAE,QAAQ;KAC7C,CAAC,CAAC;IAEH,OAAO,CACH,kBACI,IAAI,EAAC,QAAQ,EACb,EAAE,EAAE,EAAE,EACN,SAAS,EAAE,eAAe,EAC1B,IAAI,EAAC,QAAQ,kBACC,OAAO,gBACT,SAAS,EACrB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,YAAY,iBACR,wBAAwB,EAAE,EAAE;YAEzC,eAAM,SAAS,EAAC,6BAA6B,GAAG,EAChD,eAAM,SAAS,EAAC,6BAA6B,GAAG;YAC3C,CACZ,CAAC;AAAA,CACL,CAAC,CAAC"}
|
|
@@ -14,16 +14,10 @@ export interface ILegendGroupColorProps {
|
|
|
14
14
|
* Enables toggle behavior for segment filtering.
|
|
15
15
|
*/
|
|
16
16
|
onItemClick?: (uri: string) => void;
|
|
17
|
+
/**
|
|
18
|
+
* Enables enhanced keyboard semantics for interactive color list.
|
|
19
|
+
*/
|
|
20
|
+
enableGeoChartA11yImprovements?: boolean;
|
|
17
21
|
}
|
|
18
|
-
/**
|
|
19
|
-
* Legend group displaying categorical color items.
|
|
20
|
-
*
|
|
21
|
-
* @remarks
|
|
22
|
-
* Renders a list of color category items with colored swatches and labels.
|
|
23
|
-
* Used for segment/category-based coloring in both pushpin and area layers.
|
|
24
|
-
* Supports click-to-toggle for segment filtering.
|
|
25
|
-
*
|
|
26
|
-
* @internal
|
|
27
|
-
*/
|
|
28
22
|
export declare const LegendGroupColor: import("react").NamedExoticComponent<ILegendGroupColorProps>;
|
|
29
23
|
//# sourceMappingURL=LegendGroupColor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendGroupColor.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LegendGroupColor.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColor.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAEH,KAAK,YAAY,EAEpB,MAAM,6BAA6B,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;IAEpB;;;OAGG;IACH,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAEpC;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;CAC5C;AAkPD,eAAO,MAAM,gBAAgB,8DAU3B,CAAC"}
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
|
-
import { memo } from "react";
|
|
3
|
+
import { memo, useCallback, useEffect, useId, useMemo, useRef, useState, } from "react";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
+
import { useAutoupdateRef } from "@gooddata/sdk-ui";
|
|
6
|
+
import { makeLinearKeyboardNavigation, useIdPrefixed } from "@gooddata/sdk-ui-kit";
|
|
5
7
|
import { isLegendColorCategoryItem, } from "../../types/legend/model.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
function EnhancedColorCategoryItem({ item, id, isActive, isInteractive, onClick, }) {
|
|
9
|
+
const itemClassName = cx("gd-geo-multi-layer-legend__color-item", {
|
|
10
|
+
"gd-geo-multi-layer-legend__color-item--clickable": isInteractive,
|
|
11
|
+
"gd-geo-multi-layer-legend__color-item--disabled": !item.isVisible,
|
|
12
|
+
"gd-geo-multi-layer-legend__color-item--active": isActive,
|
|
13
|
+
});
|
|
14
|
+
return (_jsxs("div", { id: id, className: itemClassName, role: "option", "aria-selected": isInteractive ? item.isVisible : undefined, "aria-label": item.label, onClick: isInteractive ? onClick : undefined, "data-testid": `gd-geo-legend-color-item-${item.uri}`, children: [
|
|
15
|
+
_jsx("span", { className: "gd-geo-multi-layer-legend__color-swatch", style: { backgroundColor: item.color } }), _jsx("span", { className: "gd-geo-multi-layer-legend__color-label", children: item.label }), item.count !== undefined && (_jsxs("span", { className: "gd-geo-multi-layer-legend__color-count", children: ["(", item.count, ")"] }))] }));
|
|
16
|
+
}
|
|
17
|
+
function LegacyColorCategoryItem({ item, onClick }) {
|
|
11
18
|
const handleClick = () => {
|
|
12
19
|
onClick?.(item.uri);
|
|
13
20
|
};
|
|
@@ -25,6 +32,9 @@ function ColorCategoryItem({ item, onClick }) {
|
|
|
25
32
|
return (_jsxs("div", { className: itemClassName, role: isClickable ? "button" : undefined, tabIndex: isClickable ? 0 : undefined, onClick: isClickable ? handleClick : undefined, onKeyDown: isClickable ? handleKeyDown : undefined, "aria-pressed": isClickable ? item.isVisible : undefined, "aria-label": `Category: ${item.label}, Color: ${item.color}${item.isVisible ? "" : " (hidden)"}`, "data-testid": `gd-geo-legend-color-item-${item.uri}`, children: [
|
|
26
33
|
_jsx("span", { className: "gd-geo-multi-layer-legend__color-swatch", style: { backgroundColor: item.color } }), _jsx("span", { className: "gd-geo-multi-layer-legend__color-label", title: item.label, children: item.label }), item.count !== undefined && (_jsxs("span", { className: "gd-geo-multi-layer-legend__color-count", children: ["(", item.count, ")"] }))] }));
|
|
27
34
|
}
|
|
35
|
+
function makeItemId(prefix, index) {
|
|
36
|
+
return `${prefix}-item-${index}`;
|
|
37
|
+
}
|
|
28
38
|
/**
|
|
29
39
|
* Legend group displaying categorical color items.
|
|
30
40
|
*
|
|
@@ -35,9 +45,74 @@ function ColorCategoryItem({ item, onClick }) {
|
|
|
35
45
|
*
|
|
36
46
|
* @internal
|
|
37
47
|
*/
|
|
38
|
-
|
|
48
|
+
function LegacyLegendGroupColor({ group, onItemClick, }) {
|
|
39
49
|
const colorItems = group.items.filter(isLegendColorCategoryItem);
|
|
40
|
-
return (_jsxs("div", { className: "gd-geo-multi-layer-legend__group gd-geo-multi-layer-legend__group--color", children: [group.title ? (_jsx("div", { className: "gd-geo-multi-layer-legend__group-title", title: group.title, children: group.title })) : null, _jsx("div", { className: "gd-geo-multi-layer-legend__color-list", children: colorItems.map((item) => (_jsx(
|
|
50
|
+
return (_jsxs("div", { className: "gd-geo-multi-layer-legend__group gd-geo-multi-layer-legend__group--color", children: [group.title ? (_jsx("div", { className: "gd-geo-multi-layer-legend__group-title", title: group.title, children: group.title })) : null, _jsx("div", { className: "gd-geo-multi-layer-legend__color-list", children: colorItems.map((item) => (_jsx(LegacyColorCategoryItem, { item: item, onClick: onItemClick }, item.uri))) })
|
|
41
51
|
] }));
|
|
52
|
+
}
|
|
53
|
+
function EnhancedLegendGroupColor({ group, onItemClick, }) {
|
|
54
|
+
const colorItems = group.items.filter(isLegendColorCategoryItem);
|
|
55
|
+
const isInteractive = Boolean(onItemClick);
|
|
56
|
+
const titleId = useId();
|
|
57
|
+
const idPrefix = useIdPrefixed("geo-color-list");
|
|
58
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
59
|
+
const listRef = useRef(null);
|
|
60
|
+
const depsRef = useAutoupdateRef({
|
|
61
|
+
activeIndex,
|
|
62
|
+
onItemClick,
|
|
63
|
+
colorItems,
|
|
64
|
+
});
|
|
65
|
+
// Clamp activeIndex if items shrink
|
|
66
|
+
const clampedIndex = Math.min(activeIndex, Math.max(colorItems.length - 1, 0));
|
|
67
|
+
const ensureActiveItemVisible = useCallback(() => {
|
|
68
|
+
if (!isInteractive) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const listElement = listRef.current;
|
|
72
|
+
if (!listElement) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
if (document.activeElement !== listElement) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const activeItemId = makeItemId(idPrefix, clampedIndex);
|
|
79
|
+
const activeItemElement = listElement.querySelector(`#${CSS.escape(activeItemId)}`);
|
|
80
|
+
activeItemElement?.scrollIntoView?.({ block: "nearest" });
|
|
81
|
+
}, [clampedIndex, idPrefix, isInteractive]);
|
|
82
|
+
const handleKeyDown = useMemo(() => makeLinearKeyboardNavigation({
|
|
83
|
+
onFocusNext: () => {
|
|
84
|
+
setActiveIndex((prev) => (prev + 1 < depsRef.current.colorItems.length ? prev + 1 : 0));
|
|
85
|
+
},
|
|
86
|
+
onFocusPrevious: () => {
|
|
87
|
+
setActiveIndex((prev) => prev - 1 >= 0 ? prev - 1 : depsRef.current.colorItems.length - 1);
|
|
88
|
+
},
|
|
89
|
+
onFocusFirst: () => {
|
|
90
|
+
setActiveIndex(0);
|
|
91
|
+
},
|
|
92
|
+
onFocusLast: () => {
|
|
93
|
+
setActiveIndex(depsRef.current.colorItems.length - 1);
|
|
94
|
+
},
|
|
95
|
+
onSelect: () => {
|
|
96
|
+
const { onItemClick, colorItems, activeIndex } = depsRef.current;
|
|
97
|
+
const activeItem = colorItems[activeIndex];
|
|
98
|
+
if (activeItem) {
|
|
99
|
+
onItemClick?.(activeItem.uri);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
}), [depsRef]);
|
|
103
|
+
useEffect(() => {
|
|
104
|
+
ensureActiveItemVisible();
|
|
105
|
+
}, [ensureActiveItemVisible]);
|
|
106
|
+
const handleListFocus = useCallback(() => {
|
|
107
|
+
ensureActiveItemVisible();
|
|
108
|
+
}, [ensureActiveItemVisible]);
|
|
109
|
+
return (_jsxs("div", { className: "gd-geo-multi-layer-legend__group gd-geo-multi-layer-legend__group--color", role: "group", "aria-labelledby": group.title ? titleId : undefined, children: [group.title ? (_jsx("div", { id: titleId, className: "gd-geo-multi-layer-legend__group-title", children: group.title })) : null, _jsx("div", { ref: listRef, className: "gd-geo-multi-layer-legend__color-list", role: isInteractive ? "listbox" : "list", "aria-label": group.title, "aria-multiselectable": isInteractive ? true : undefined, "aria-activedescendant": isInteractive && colorItems.length > 0 ? makeItemId(idPrefix, clampedIndex) : undefined, tabIndex: isInteractive ? 0 : undefined, onKeyDown: isInteractive ? handleKeyDown : undefined, onFocus: isInteractive ? handleListFocus : undefined, children: colorItems.map((item, index) => (_jsx(EnhancedColorCategoryItem, { item: item, id: makeItemId(idPrefix, index), isActive: isInteractive ? index === clampedIndex : false, isInteractive: isInteractive, onClick: () => onItemClick?.(item.uri) }, item.uri))) })
|
|
110
|
+
] }));
|
|
111
|
+
}
|
|
112
|
+
export const LegendGroupColor = memo(function LegendGroupColor({ group, onItemClick, enableGeoChartA11yImprovements = false, }) {
|
|
113
|
+
if (!enableGeoChartA11yImprovements) {
|
|
114
|
+
return _jsx(LegacyLegendGroupColor, { group: group, onItemClick: onItemClick });
|
|
115
|
+
}
|
|
116
|
+
return _jsx(EnhancedLegendGroupColor, { group: group, onItemClick: onItemClick });
|
|
42
117
|
});
|
|
43
118
|
//# sourceMappingURL=LegendGroupColor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendGroupColor.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColor.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,
|
|
1
|
+
{"version":3,"file":"LegendGroupColor.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColor.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAKH,IAAI,EACJ,WAAW,EACX,SAAS,EACT,KAAK,EACL,OAAO,EACP,MAAM,EACN,QAAQ,GACX,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,4BAA4B,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,EAGH,yBAAyB,GAC5B,MAAM,6BAA6B,CAAC;AAiCrC,SAAS,yBAAyB,CAAC,EAC/B,IAAI,EACJ,EAAE,EACF,QAAQ,EACR,aAAa,EACb,OAAO,GACuB,EAAgB;IAC9C,MAAM,aAAa,GAAG,EAAE,CAAC,uCAAuC,EAAE;QAC9D,kDAAkD,EAAE,aAAa;QACj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
|
import { type ILegendGroup } from "../../types/legend/model.js";
|
|
2
3
|
/**
|
|
3
4
|
* Props for LegendGroupColorScale component.
|
|
@@ -9,6 +10,18 @@ export interface ILegendGroupColorScaleProps {
|
|
|
9
10
|
* Legend group with color scale item.
|
|
10
11
|
*/
|
|
11
12
|
group: ILegendGroup;
|
|
13
|
+
/**
|
|
14
|
+
* Enables enhanced a11y semantics for the color scale group.
|
|
15
|
+
*/
|
|
16
|
+
enableGeoChartA11yImprovements?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Optional formatter for accessibility labels/messages.
|
|
19
|
+
*/
|
|
20
|
+
formatMessage?: LegendMessageFormatter;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the color scale can be reached via keyboard.
|
|
23
|
+
*/
|
|
24
|
+
isFocusable?: boolean;
|
|
12
25
|
}
|
|
13
26
|
/**
|
|
14
27
|
* Legend group displaying a numeric color scale (gradient).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendGroupColorScale.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColorScale.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LegendGroupColorScale.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColorScale.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAEH,KAAK,YAAY,EAEpB,MAAM,6BAA6B,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,2BAA2B;IACxC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;IAEpB;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;OAEG;IACH,aAAa,CAAC,EAAE,sBAAsB,CAAC;IAEvC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAqDD;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,mEA2ChC,CAAC"}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { memo } from "react";
|
|
4
|
+
import { LegendGroupContainer } from "./LegendGroupContainer.js";
|
|
4
5
|
import { isLegendColorScaleItem, } from "../../types/legend/model.js";
|
|
5
6
|
/**
|
|
6
7
|
* Renders the min-max color scale with gradient.
|
|
7
8
|
*/
|
|
8
|
-
function ColorScaleItem({ item }) {
|
|
9
|
+
function ColorScaleItem({ item, enableGeoChartA11yImprovements, formatMessage, }) {
|
|
9
10
|
const hasCustomColors = Boolean(item.minColor) && Boolean(item.maxColor);
|
|
10
11
|
const barStyle = hasCustomColors
|
|
11
12
|
? {
|
|
12
13
|
background: `linear-gradient(to right, ${item.minColor}, ${item.maxColor})`,
|
|
13
14
|
}
|
|
14
15
|
: undefined;
|
|
16
|
+
const scaleLabel = formatMessage?.("geochart.legend.colorScale.label", {
|
|
17
|
+
min: item.minLabel,
|
|
18
|
+
max: item.maxLabel,
|
|
19
|
+
}) ?? `Color scale from ${item.minLabel} to ${item.maxLabel}`;
|
|
15
20
|
return (_jsxs("div", { className: "gd-geo-multi-layer-legend__color-scale", children: [
|
|
16
|
-
_jsx("div", { className: "gd-geo-multi-layer-legend__color-scale-bar", style: barStyle }), _jsxs("div", { className: "gd-geo-multi-layer-legend__color-scale-labels", children: [
|
|
17
|
-
_jsx("span", { className: "gd-geo-multi-layer-legend__color-scale-min", title: item.minLabel, children: item.minLabel }), _jsx("span", { className: "gd-geo-multi-layer-legend__color-scale-max", title: item.maxLabel, children: item.maxLabel })
|
|
21
|
+
_jsx("div", { className: "gd-geo-multi-layer-legend__color-scale-bar", style: barStyle, role: enableGeoChartA11yImprovements ? "img" : undefined, "aria-label": enableGeoChartA11yImprovements ? scaleLabel : undefined }), _jsxs("div", { className: "gd-geo-multi-layer-legend__color-scale-labels", children: [
|
|
22
|
+
_jsx("span", { className: "gd-geo-multi-layer-legend__color-scale-min", title: enableGeoChartA11yImprovements ? undefined : item.minLabel, children: item.minLabel }), _jsx("span", { className: "gd-geo-multi-layer-legend__color-scale-max", title: enableGeoChartA11yImprovements ? undefined : item.maxLabel, children: item.maxLabel })
|
|
18
23
|
] })
|
|
19
24
|
] }));
|
|
20
25
|
}
|
|
@@ -28,8 +33,11 @@ function ColorScaleItem({ item }) {
|
|
|
28
33
|
*
|
|
29
34
|
* @internal
|
|
30
35
|
*/
|
|
31
|
-
export const LegendGroupColorScale = memo(function LegendGroupColorScale({ group, }) {
|
|
36
|
+
export const LegendGroupColorScale = memo(function LegendGroupColorScale({ group, enableGeoChartA11yImprovements = false, formatMessage, isFocusable = false, }) {
|
|
32
37
|
const scaleItem = group.items.find(isLegendColorScaleItem);
|
|
33
|
-
|
|
38
|
+
if (!enableGeoChartA11yImprovements) {
|
|
39
|
+
return (_jsxs("div", { className: "gd-geo-multi-layer-legend__group gd-geo-multi-layer-legend__group--color-scale", children: [group.title ? (_jsx("div", { className: "gd-geo-multi-layer-legend__group-title", title: group.title, children: group.title })) : null, scaleItem ? (_jsx(ColorScaleItem, { item: scaleItem, enableGeoChartA11yImprovements: enableGeoChartA11yImprovements, formatMessage: formatMessage })) : null] }));
|
|
40
|
+
}
|
|
41
|
+
return (_jsx(LegendGroupContainer, { variantClassName: "gd-geo-multi-layer-legend__group--color-scale", title: group.title, isFocusable: isFocusable, useFocusTarget: true, children: scaleItem ? (_jsx(ColorScaleItem, { item: scaleItem, enableGeoChartA11yImprovements: enableGeoChartA11yImprovements, formatMessage: formatMessage })) : null }));
|
|
34
42
|
});
|
|
35
43
|
//# sourceMappingURL=LegendGroupColorScale.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendGroupColorScale.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColorScale.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,IAAI,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAGH,sBAAsB,GACzB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"LegendGroupColorScale.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupColorScale.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,IAAI,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAGH,sBAAsB,GACzB,MAAM,6BAA6B,CAAC;AA6BrC;;GAEG;AACH,SAAS,cAAc,CAAC,EACpB,IAAI,EACJ,8BAA8B,EAC9B,aAAa,GAKhB,EAAgB;IACb,MAAM,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzE,MAAM,QAAQ,GAAG,eAAe;QAC5B,CAAC,CAAC;YACI,UAAU,EAAE,6BAA6B,IAAI,CAAC,QAAQ,KAAK,IAAI,CAAC,QAAQ,GAAG;SAC9E;QACH,CAAC,CAAC,SAAS,CAAC;IAEhB,MAAM,UAAU,GACZ,aAAa,EAAE,CAAC,kCAAkC,EAAE;QAChD,GAAG,EAAE,IAAI,CAAC,QAAQ;QAClB,GAAG,EAAE,IAAI,CAAC,QAAQ;KACrB,CAAC,IAAI,oBAAoB,IAAI,CAAC,QAAQ,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;IAElE,OAAO,CACH,eAAK,SAAS,EAAC,wCAAwC;YACnD,cACI,SAAS,EAAC,4CAA4C,EACtD,KAAK,EAAE,QAAQ,EACf,IAAI,EAAE,8BAA8B,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,gBAC5C,8BAA8B,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,GACrE,EACF,eAAK,SAAS,EAAC,+CAA+C;oBAC1D,eACI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AE,8BAA8B,EAC9D,aAAa,EAAE,aAAa,GAC9B,CACL,CAAC,CAAC,CAAC,IAAI,GACW,CAC1B,CAAC;AAAA,CACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
interface ILegendGroupContainerProps {
|
|
3
|
+
variantClassName: string;
|
|
4
|
+
title?: string;
|
|
5
|
+
isFocusable?: boolean;
|
|
6
|
+
useFocusTarget?: boolean;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Shared semantic wrapper for enhanced legend groups.
|
|
11
|
+
*
|
|
12
|
+
* Keeps role/label/focusability behavior consistent across group variants.
|
|
13
|
+
*/
|
|
14
|
+
export declare const LegendGroupContainer: import("react").NamedExoticComponent<ILegendGroupContainerProps>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=LegendGroupContainer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendGroupContainer.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupContainer.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,SAAS,EAAe,MAAM,OAAO,CAAC;AAIvE,UAAU,0BAA0B;IAChC,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,kEAuC/B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// (C) 2025-2026 GoodData Corporation
|
|
3
|
+
import { memo, useId } from "react";
|
|
4
|
+
import cx from "classnames";
|
|
5
|
+
/**
|
|
6
|
+
* Shared semantic wrapper for enhanced legend groups.
|
|
7
|
+
*
|
|
8
|
+
* Keeps role/label/focusability behavior consistent across group variants.
|
|
9
|
+
*/
|
|
10
|
+
export const LegendGroupContainer = memo(function LegendGroupContainer({ variantClassName, title, isFocusable = false, useFocusTarget = false, children, }) {
|
|
11
|
+
const titleId = useId();
|
|
12
|
+
const groupClassName = cx("gd-geo-multi-layer-legend__group", variantClassName, isFocusable && "gd-geo-multi-layer-legend__group--focusable");
|
|
13
|
+
const content = (_jsxs(_Fragment, { children: [title ? (_jsx("div", { id: titleId, className: "gd-geo-multi-layer-legend__group-title", children: title })) : null, children] }));
|
|
14
|
+
return (_jsx("div", { className: groupClassName, role: "group", "aria-labelledby": title ? titleId : undefined, tabIndex: isFocusable ? 0 : undefined, children: useFocusTarget ? (_jsx("div", { className: "gd-geo-multi-layer-legend__group-focus-target", children: content })) : (content) }));
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=LegendGroupContainer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LegendGroupContainer.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupContainer.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqC,IAAI,EAAE,KAAK,EAAE,MAAM,OAAO,CAAC;AAEvE,OAAO,EAAE,MAAM,YAAY,CAAC;AAU5B;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,SAAS,oBAAoB,CAAC,EACnE,gBAAgB,EAChB,KAAK,EACL,WAAW,GAAG,KAAK,EACnB,cAAc,GAAG,KAAK,EACtB,QAAQ,GACiB,EAAgB;IACzC,MAAM,OAAO,GAAG,KAAK,EAAE,CAAC;IACxB,MAAM,cAAc,GAAG,EAAE,CACrB,kCAAkC,EAClC,gBAAgB,EAChB,WAAW,IAAI,6CAA6C,CAC/D,CAAC;IAEF,MAAM,OAAO,GAAG,CACZ,8BACK,KAAK,CAAC,CAAC,CAAC,CACL,cAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAC,wCAAwC,YAC/D,KAAK,GACJ,CACT,CAAC,CAAC,CAAC,IAAI,EACP,QAAQ,IACV,CACN,CAAC;IAEF,OAAO,CACH,cACI,SAAS,EAAE,cAAc,EACzB,IAAI,EAAC,OAAO,qBACK,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC5C,QAAQ,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,YAEpC,cAAc,CAAC,CAAC,CAAC,CACd,cAAK,SAAS,EAAC,+CAA+C,YAAE,OAAO,GAAO,CACjF,CAAC,CAAC,CAAC,CACA,OAAO,CACV,GACC,CACT,CAAC;AAAA,CACL,CAAC,CAAC"}
|
|
@@ -9,6 +9,14 @@ export interface ILegendGroupSizeProps {
|
|
|
9
9
|
* Legend group with size anchor items.
|
|
10
10
|
*/
|
|
11
11
|
group: ILegendGroup;
|
|
12
|
+
/**
|
|
13
|
+
* Enables enhanced a11y semantics for the size list.
|
|
14
|
+
*/
|
|
15
|
+
enableGeoChartA11yImprovements?: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the size list can be reached via keyboard.
|
|
18
|
+
*/
|
|
19
|
+
isFocusable?: boolean;
|
|
12
20
|
}
|
|
13
21
|
/**
|
|
14
22
|
* Legend group displaying size anchors for pushpin layers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendGroupSize.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupSize.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LegendGroupSize.d.ts","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupSize.tsx"],"names":[],"mappings":"AAKA,OAAO,EACH,KAAK,YAAY,EAGpB,MAAM,6BAA6B,CAAC;AAErC;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,KAAK,EAAE,YAAY,CAAC;IAEpB;;OAEG;IACH,8BAA8B,CAAC,EAAE,OAAO,CAAC;IAEzC;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAsBD;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,6DAmD1B,CAAC"}
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
// (C) 2025-2026 GoodData Corporation
|
|
3
3
|
import { memo } from "react";
|
|
4
|
+
import { LegendGroupContainer } from "./LegendGroupContainer.js";
|
|
4
5
|
import { isLegendSizeAnchorItem, } from "../../types/legend/model.js";
|
|
5
6
|
/**
|
|
6
7
|
* Renders a single size anchor (circle) with its label.
|
|
7
8
|
*/
|
|
8
9
|
function SizeAnchorItem({ item }) {
|
|
9
|
-
return (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
return (_jsx("div", { className: "gd-geo-multi-layer-legend__size-anchor-wrapper", role: "listitem", children: _jsxs("div", { className: "gd-geo-multi-layer-legend__size-anchor", children: [
|
|
11
|
+
_jsx("span", { className: "gd-geo-multi-layer-legend__size-circle", style: {
|
|
12
|
+
width: item.sizePx,
|
|
13
|
+
height: item.sizePx,
|
|
14
|
+
} }), _jsx("span", { className: "gd-geo-multi-layer-legend__size-label", children: item.label })
|
|
15
|
+
] }) }));
|
|
15
16
|
}
|
|
16
17
|
/**
|
|
17
18
|
* Legend group displaying size anchors for pushpin layers.
|
|
@@ -23,9 +24,17 @@ function SizeAnchorItem({ item }) {
|
|
|
23
24
|
*
|
|
24
25
|
* @internal
|
|
25
26
|
*/
|
|
26
|
-
export const LegendGroupSize = memo(function LegendGroupSize({ group }) {
|
|
27
|
+
export const LegendGroupSize = memo(function LegendGroupSize({ group, enableGeoChartA11yImprovements = false, isFocusable = false, }) {
|
|
27
28
|
const sizeItems = group.items.filter(isLegendSizeAnchorItem);
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
if (!enableGeoChartA11yImprovements) {
|
|
30
|
+
return (_jsxs("div", { className: "gd-geo-multi-layer-legend__group gd-geo-multi-layer-legend__group--size", children: [group.title ? (_jsx("div", { className: "gd-geo-multi-layer-legend__group-title", title: group.title, children: group.title })) : null, _jsx("div", { className: "gd-geo-multi-layer-legend__size-list", children: sizeItems.map((item, index) => (_jsxs("div", { className: "gd-geo-multi-layer-legend__size-anchor", "aria-label": `Size: ${item.label}`, children: [
|
|
31
|
+
_jsx("span", { className: "gd-geo-multi-layer-legend__size-circle", style: {
|
|
32
|
+
width: item.sizePx,
|
|
33
|
+
height: item.sizePx,
|
|
34
|
+
} }), _jsx("span", { className: "gd-geo-multi-layer-legend__size-label", children: item.label })
|
|
35
|
+
] }, index))) })
|
|
36
|
+
] }));
|
|
37
|
+
}
|
|
38
|
+
return (_jsx(LegendGroupContainer, { variantClassName: "gd-geo-multi-layer-legend__group--size", title: group.title, isFocusable: isFocusable, useFocusTarget: true, children: _jsx("div", { className: "gd-geo-multi-layer-legend__size-list", role: "list", "aria-label": group.title, children: sizeItems.map((item, index) => (_jsx(SizeAnchorItem, { item: item }, index))) }) }));
|
|
30
39
|
});
|
|
31
40
|
//# sourceMappingURL=LegendGroupSize.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendGroupSize.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupSize.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,IAAI,EAAE,MAAM,OAAO,CAAC;AAEhD,OAAO,EAGH,sBAAsB,GACzB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"LegendGroupSize.js","sourceRoot":"","sources":["../../../../src/next/components/multiLayerLegend/LegendGroupSize.tsx"],"names":[],"mappings":";AAAA,qCAAqC;AAErC,OAAO,EAAqB,IAAI,EAAE,MAAM,OAAO,CAA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AAK,EAAE,IAAI,CAAC,MAAM;oCAClB,MAAM,EAAE,IAAI,CAAC,MAAM;iCACtB,GACH,EACF,eAAM,SAAS,EAAC,uCAAuC,YAAE,IAAI,CAAC,KAAK,GAAQ;6BAXtE,KAAK,CAYR,CACT,CAAC,GACA;gBACJ,CACT,CAAC;IACN,CAAC;IAED,OAAO,CACH,KAAC,oBAAoB,IACjB,gBAAgB,EAAC,wCAAwC,EACzD,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,WAAW,EAAE,WAAW,EACxB,cAAc,kBAEd,cAAK,SAAS,EAAC,sCAAsC,EAAC,IAAI,EAAC,MAAM,gBAAa,KAAK,CAAC,KAAK,YACpF,SAAS,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC5B,KAAC,cAAc,IAAa,IAAI,EAAE,IAAI,IAAjB,KAAK,CAAgB,CAC7C,CAAC,GACA,GACa,CAC1B,CAAC;AAAA,CACL,CAAC,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { PositionType } from "@gooddata/sdk-ui-vis-commons";
|
|
2
|
+
import { type LegendMessageFormatter } from "./legendMessages.js";
|
|
2
3
|
import { type ILegendModel } from "../../types/legend/model.js";
|
|
3
4
|
/**
|
|
4
5
|
* Props for MultiLayerLegendPanel component.
|
|
@@ -41,6 +42,18 @@ export interface IMultiLayerLegendPanelProps {
|
|
|
41
42
|
* @param uri - The URI of the clicked item
|
|
42
43
|
*/
|
|
43
44
|
onItemClick?: (layerId: string, uri: string) => void;
|
|
45
|
+
/**
|
|
46
|
+
* Enables enhanced a11y semantics and live announcements for legend interactions.
|
|
47
|
+
*/
|
|
48
|
+
enableGeoChartA11yImprovements?: boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Optional formatter for accessibility messages.
|
|
51
|
+
*/
|
|
52
|
+
formatMessage?: LegendMessageFormatter;
|
|
53
|
+
/**
|
|
54
|
+
* Optional ref callback to expose panel root DOM element.
|
|
55
|
+
*/
|
|
56
|
+
setPanelElementRef?: (element: HTMLDivElement | null) => void;
|
|
44
57
|
}
|
|
45
58
|
export declare const MultiLayerLegendPanel: import("react").NamedExoticComponent<IMultiLayerLegendPanelProps>;
|
|
46
59
|
//# sourceMappingURL=MultiLayerLegendPanel.d.ts.map
|