@gooddata/sdk-ui-vis-commons 11.50.0-alpha.2 → 11.50.0-alpha.4
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/legend/LegendItem.js
CHANGED
|
@@ -110,7 +110,7 @@ export const LegendItem = withTheme(function LegendItem({ item, index, width, en
|
|
|
110
110
|
_jsx("div", { className: "series-icon", style: iconStyle, children: item.isVisible && isPatternFill && isPatternObject(item.color) ? (_jsx(PatternFill, { patternFill: item.color?.pattern })) : null }), _jsx("div", { id: legendItemId, className: "series-name", style: nameStyle, children: item.name })
|
|
111
111
|
] }));
|
|
112
112
|
}
|
|
113
|
-
return (_jsxs("button", { ref: refCallback, "data-testid": "legend-item", role: "
|
|
113
|
+
return (_jsxs("button", { ref: refCallback, "data-testid": "legend-item", role: "option", "aria-selected": item.isVisible, id: id, style: style, className: cx("series-item", { "series-item--isFocused": isFocused }), onClick: handleItemClick, "aria-labelledby": legendItemId, title: unescape(item.name), tabIndex: -1, children: [
|
|
114
114
|
_jsx("div", { className: "series-icon", style: iconStyle, children: item.isVisible && isPatternFill && isPatternObject(item.color) ? (_jsx(PatternFill, { patternFill: item.color?.pattern })) : null }), _jsx("div", { id: legendItemId, className: "series-name", style: nameStyle, children: item.name })
|
|
115
115
|
] }));
|
|
116
116
|
});
|
package/esm/legend/LegendList.js
CHANGED
|
@@ -14,7 +14,7 @@ const LegendListItem = memo(function LegendListItem({ index, item, enableBorderR
|
|
|
14
14
|
return _jsx(LegendSeparator, {}, index);
|
|
15
15
|
}
|
|
16
16
|
if (isSeriesItemMetric(item)) {
|
|
17
|
-
return (_jsx("div", { style: { display: "contents" }, role: "
|
|
17
|
+
return (_jsx("div", { style: { display: "contents" }, role: "none", children: _jsx(LegendItem, { index: index, enableBorderRadius: borderRadius, item: item, width: width, onItemClick: onItemClick, chartFill: chartFill }, index) }));
|
|
18
18
|
}
|
|
19
19
|
return null;
|
|
20
20
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendSeries.d.ts","sourceRoot":"","sources":["../../src/legend/LegendSeries.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,SAAS,EAIjB,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,YAAY,CAAC;AAGlE,UAAU,kBAAkB;IACxB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,
|
|
1
|
+
{"version":3,"file":"LegendSeries.d.ts","sourceRoot":"","sources":["../../src/legend/LegendSeries.tsx"],"names":[],"mappings":"AAEA,OAAO,EACH,KAAK,aAAa,EAGlB,KAAK,SAAS,EAIjB,MAAM,OAAO,CAAC;AASf,OAAO,EAAE,KAAK,WAAW,EAAsB,MAAM,YAAY,CAAC;AAGlE,UAAU,kBAAkB;IACxB,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,CAAC;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,4GAwGvB,CAAC"}
|
|
@@ -11,10 +11,11 @@ import { useVisibilityDetection } from "./visibilityDetection.js";
|
|
|
11
11
|
export const LegendSeries = forwardRef(function LegendSeries({ series, label, style, children, onToggleItem, className }, ref) {
|
|
12
12
|
const { formatMessage } = useIntl();
|
|
13
13
|
// Create mapping of focusable items to their original indices
|
|
14
|
+
// Anomaly items render as passive (no option role), so they must not become the active descendant
|
|
14
15
|
const focusableIndicesMap = useMemo(() => {
|
|
15
16
|
const map = [];
|
|
16
17
|
series.forEach((item, index) => {
|
|
17
|
-
if (isSeriesItemMetric(item)) {
|
|
18
|
+
if (isSeriesItemMetric(item) && !item.anomaly) {
|
|
18
19
|
map.push(index);
|
|
19
20
|
}
|
|
20
21
|
});
|
|
@@ -64,9 +65,9 @@ export const LegendSeries = forwardRef(function LegendSeries({ series, label, st
|
|
|
64
65
|
onToggleItem(series[focusedIndex]);
|
|
65
66
|
},
|
|
66
67
|
}), [keyDownDepsRef, visibilityContextValue, focusableIndicesMap]);
|
|
67
|
-
return (_jsx(LegendSeriesContextStore, { value: legendContextValue, children: _jsx(VisibilityContext.Provider, { value: visibilityContextValue, children: _jsx("div", { className: cx("series-wrapper legend-series-wrapper", className), role: "
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
return (_jsx(LegendSeriesContextStore, { value: legendContextValue, children: _jsx(VisibilityContext.Provider, { value: visibilityContextValue, children: _jsx("div", { className: cx("series-wrapper legend-series-wrapper", className), role: "listbox", "aria-multiselectable": true, "aria-activedescendant": makeItemId(series[focusedIndex]), "aria-label": label
|
|
69
|
+
? formatMessage({ id: "properties.legend.series.named" }, { name: label })
|
|
70
|
+
: formatMessage({ id: "properties.legend.series.unnamed" }), tabIndex: 0, onKeyDown: handleKeyDown, ref: viewportRefCallback, children: _jsx("div", { className: "series legend-series", role: "none", style: style, ref: ref, children: children }) }) }) }));
|
|
70
71
|
});
|
|
71
72
|
// Helper functions for finding visible items using original indices
|
|
72
73
|
const findFirstVisibleOriginal = (focusableIndicesMap, isVisible) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-vis-commons",
|
|
3
|
-
"version": "11.50.0-alpha.
|
|
3
|
+
"version": "11.50.0-alpha.4",
|
|
4
4
|
"description": "GoodData.UI SDK - common functionality for different types of visualizations",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "GoodData Corporation",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"react-intl": "7.1.11",
|
|
37
37
|
"react-measure": "^2.5.2",
|
|
38
38
|
"tslib": "2.8.1",
|
|
39
|
-
"@gooddata/sdk-backend-spi": "11.50.0-alpha.
|
|
40
|
-
"@gooddata/sdk-ui": "11.50.0-alpha.
|
|
41
|
-
"@gooddata/sdk-model": "11.50.0-alpha.
|
|
42
|
-
"@gooddata/sdk-ui-theme-provider": "11.50.0-alpha.
|
|
43
|
-
"@gooddata/sdk-ui
|
|
39
|
+
"@gooddata/sdk-backend-spi": "11.50.0-alpha.4",
|
|
40
|
+
"@gooddata/sdk-ui-kit": "11.50.0-alpha.4",
|
|
41
|
+
"@gooddata/sdk-model": "11.50.0-alpha.4",
|
|
42
|
+
"@gooddata/sdk-ui-theme-provider": "11.50.0-alpha.4",
|
|
43
|
+
"@gooddata/sdk-ui": "11.50.0-alpha.4"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@microsoft/api-documenter": "^7.17.0",
|
|
@@ -81,11 +81,11 @@
|
|
|
81
81
|
"typescript": "5.9.3",
|
|
82
82
|
"vitest": "4.1.8",
|
|
83
83
|
"vitest-dom": "0.1.1",
|
|
84
|
-
"@gooddata/
|
|
85
|
-
"@gooddata/
|
|
86
|
-
"@gooddata/reference-workspace": "11.50.0-alpha.
|
|
87
|
-
"@gooddata/sdk-backend-mockingbird": "11.50.0-alpha.
|
|
88
|
-
"@gooddata/stylelint-config": "11.50.0-alpha.
|
|
84
|
+
"@gooddata/oxlint-config": "11.50.0-alpha.4",
|
|
85
|
+
"@gooddata/eslint-config": "11.50.0-alpha.4",
|
|
86
|
+
"@gooddata/reference-workspace": "11.50.0-alpha.4",
|
|
87
|
+
"@gooddata/sdk-backend-mockingbird": "11.50.0-alpha.4",
|
|
88
|
+
"@gooddata/stylelint-config": "11.50.0-alpha.4"
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"react": "^18.0.0 || ^19.0.0",
|