@gooddata/sdk-ui-vis-commons 10.24.0-alpha.13 → 10.24.0-alpha.2
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.d.ts.map +1 -1
- package/esm/legend/LegendItem.js +23 -23
- package/esm/legend/LegendItem.js.map +1 -1
- package/esm/legend/Paging.d.ts.map +1 -1
- package/esm/legend/Paging.js +11 -11
- package/esm/legend/Paging.js.map +1 -1
- package/esm/locales.d.ts.map +1 -1
- package/esm/locales.js +1 -3
- package/esm/locales.js.map +1 -1
- package/package.json +8 -8
- package/styles/scss/legend.scss +0 -15
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendItem.d.ts","sourceRoot":"","sources":["../../src/legend/LegendItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"LegendItem.d.ts","sourceRoot":"","sources":["../../src/legend/LegendItem.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAK7C,UAAU,gBAAgB;IACtB,IAAI,EAAE,GAAG,CAAC;IACV,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,WAAW,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB;;AAoCD,wBAAqC"}
|
package/esm/legend/LegendItem.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
// (C) 2007-
|
|
1
|
+
// (C) 2007-2023 GoodData Corporation
|
|
2
2
|
import React from "react";
|
|
3
3
|
import unescape from "lodash/unescape.js";
|
|
4
4
|
import { withTheme } from "@gooddata/sdk-ui-theme-provider";
|
|
5
|
-
import { useId } from "@gooddata/sdk-ui-kit";
|
|
6
5
|
const DEFAULT_DISABLED_COLOR = "#CCCCCC";
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const nameStyle = item.isVisible
|
|
15
|
-
? {}
|
|
16
|
-
: {
|
|
17
|
-
color: disabledColor,
|
|
6
|
+
class LegendItem extends React.Component {
|
|
7
|
+
render() {
|
|
8
|
+
const { item, width, enableBorderRadius = false, theme } = this.props;
|
|
9
|
+
const disabledColor = theme?.palette?.complementary?.c5 ?? DEFAULT_DISABLED_COLOR;
|
|
10
|
+
const iconStyle = {
|
|
11
|
+
borderRadius: enableBorderRadius ? "50%" : "0",
|
|
12
|
+
backgroundColor: item.isVisible ? item.color : disabledColor,
|
|
18
13
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
14
|
+
// normal state styled by css
|
|
15
|
+
const nameStyle = item.isVisible
|
|
16
|
+
? {}
|
|
17
|
+
: {
|
|
18
|
+
color: disabledColor,
|
|
19
|
+
};
|
|
20
|
+
const style = width ? { width: `${width}px` } : {};
|
|
21
|
+
const onItemClick = () => {
|
|
22
|
+
return this.props.onItemClick(item);
|
|
23
|
+
};
|
|
24
|
+
return (React.createElement("div", { style: style, className: "series-item", onClick: onItemClick, "aria-label": "Legend item" },
|
|
25
|
+
React.createElement("div", { className: "series-icon", style: iconStyle }),
|
|
26
|
+
React.createElement("div", { className: "series-name", style: nameStyle, title: unescape(item.name) }, item.name)));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
29
|
export default withTheme(LegendItem);
|
|
30
30
|
//# sourceMappingURL=LegendItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LegendItem.js","sourceRoot":"","sources":["../../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AAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACxC,CAAC,CAAC;QAEF,OAAO,CACH,6BAAK,KAAK,EAAE,KAAK,EAAE,SAAS,EAAC,aAAa,EAAC,OAAO,EAAE,WAAW,gBAAa,aAAa;YACrF,6BAAK,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,SAAS,GAAI;YACjD,6BAAK,SAAS,EAAC,aAAa,EAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IACpE,IAAI,CAAC,IAAI,CACR,CACJ,CACT,CAAC;IACN,CAAC;CACJ;AAED,eAAe,SAAS,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paging.d.ts","sourceRoot":"","sources":["../../src/legend/Paging.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Paging.d.ts","sourceRoot":"","sources":["../../src/legend/Paging.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,QAAQ,GAAG,WAAW,CAAC;AAE5D;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,IAAI,IAAI,CAAC;IACrB,YAAY,IAAI,IAAI,CAAC;IACrB,kBAAkB,CAAC,EAAE,sBAAsB,CAAC;CAC/C;AAED,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,CAAC;AA2C/C;;GAEG;AACH,eAAO,MAAM,MAAM,UAAW,YAAY,KAAG,MAAM,YAiBlD,CAAC"}
|
package/esm/legend/Paging.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// (C) 2020-
|
|
1
|
+
// (C) 2020-2023 GoodData Corporation
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { FormattedMessage
|
|
3
|
+
import { FormattedMessage } from "react-intl";
|
|
4
4
|
import cx from "classnames";
|
|
5
|
-
import { messages } from "../locales.js";
|
|
6
5
|
function getbuttonIcoStyle(type, buttonsOrientation) {
|
|
7
6
|
if (type === "prev") {
|
|
8
7
|
if (buttonsOrientation === "upDown") {
|
|
@@ -18,23 +17,24 @@ function getbuttonIcoStyle(type, buttonsOrientation) {
|
|
|
18
17
|
}
|
|
19
18
|
return undefined;
|
|
20
19
|
}
|
|
21
|
-
|
|
22
|
-
const intl = useIntl();
|
|
20
|
+
function renderPagingButton(type, buttonsOrientation, handler, disabled) {
|
|
23
21
|
const classes = cx("gd-button-link", "gd-button-icon-only", `gd-icon-chevron-${getbuttonIcoStyle(type, buttonsOrientation)}`, "paging-button");
|
|
24
|
-
const
|
|
25
|
-
|
|
26
|
-
};
|
|
22
|
+
const onClick = () => {
|
|
23
|
+
handler();
|
|
24
|
+
};
|
|
25
|
+
return React.createElement("button", { className: classes, onClick: onClick, disabled: disabled });
|
|
26
|
+
}
|
|
27
27
|
/**
|
|
28
28
|
* @internal
|
|
29
29
|
*/
|
|
30
30
|
export const Paging = (props) => {
|
|
31
31
|
const { page, pagesCount, buttonsOrientation = "upDown", showNextPage, showPrevPage } = props;
|
|
32
|
-
return (React.createElement("div", { className: "paging", "
|
|
33
|
-
|
|
32
|
+
return (React.createElement("div", { className: "paging", "aria-label": "Paging" },
|
|
33
|
+
renderPagingButton("prev", buttonsOrientation, showPrevPage, page === 1),
|
|
34
34
|
React.createElement(FormattedMessage, { id: "visualizations.of", tagName: "span", values: {
|
|
35
35
|
page: React.createElement("strong", null, page),
|
|
36
36
|
pagesCount,
|
|
37
37
|
} }),
|
|
38
|
-
|
|
38
|
+
renderPagingButton("next", buttonsOrientation, showNextPage, page === pagesCount)));
|
|
39
39
|
};
|
|
40
40
|
//# sourceMappingURL=Paging.js.map
|
package/esm/legend/Paging.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Paging.js","sourceRoot":"","sources":["../../src/legend/Paging.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"Paging.js","sourceRoot":"","sources":["../../src/legend/Paging.tsx"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAAE,MAAM,YAAY,CAAC;AAoB5B,SAAS,iBAAiB,CACtB,IAAsB,EACtB,kBAA0C;IAE1C,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAClB,IAAI,kBAAkB,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,IAAI,CAAC;QAChB,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IAED,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QAClB,IAAI,kBAAkB,KAAK,QAAQ,EAAE,CAAC;YAClC,OAAO,MAAM,CAAC;QAClB,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,OAAO,SAAS,CAAC;AACrB,CAAC;AAED,SAAS,kBAAkB,CACvB,IAAsB,EACtB,kBAA0C,EAC1C,OAAmB,EACnB,QAAiB;IAEjB,MAAM,OAAO,GAAG,EAAE,CACd,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,CAAC,EAAE,EAChE,eAAe,CAClB,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,EAAE;QACjB,OAAO,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,OAAO,gCAAQ,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC;AAChF,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAmB,EAAsB,EAAE;IAC9D,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE,kBAAkB,GAAG,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,KAAK,CAAC;IAE9F,OAAO,CACH,6BAAK,SAAS,EAAC,QAAQ,gBAAY,QAAQ;QACtC,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,IAAI,KAAK,CAAC,CAAC;QACzE,oBAAC,gBAAgB,IACb,EAAE,EAAC,mBAAmB,EACtB,OAAO,EAAC,MAAM,EACd,MAAM,EAAE;gBACJ,IAAI,EAAE,oCAAS,IAAI,CAAU;gBAC7B,UAAU;aACb,GACH;QACD,kBAAkB,CAAC,MAAM,EAAE,kBAAkB,EAAE,YAAY,EAAE,IAAI,KAAK,UAAU,CAAC,CAChF,CACT,CAAC;AACN,CAAC,CAAC"}
|
package/esm/locales.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,YAAY,CAAC;AAG/D,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAkB,MAAM,YAAY,CAAC;AAG/D,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAUrD,CAAC"}
|
package/esm/locales.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// (C) 2019-
|
|
1
|
+
// (C) 2019-2023 GoodData Corporation
|
|
2
2
|
import { defineMessages } from "react-intl";
|
|
3
3
|
//NOTE: Follow up ticket for move all messages: https://gooddata.atlassian.net/browse/FET-1050
|
|
4
4
|
export const messages = defineMessages({
|
|
@@ -11,7 +11,5 @@ export const messages = defineMessages({
|
|
|
11
11
|
line: { id: "visualizations.legend.text.line" },
|
|
12
12
|
area: { id: "visualizations.legend.text.area" },
|
|
13
13
|
combo: { id: "visualizations.legend.text.combo" },
|
|
14
|
-
previous: { id: "visualizations.pagination.previous" },
|
|
15
|
-
next: { id: "visualizations.pagination.next" },
|
|
16
14
|
});
|
|
17
15
|
//# sourceMappingURL=locales.js.map
|
package/esm/locales.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D,8FAA8F;AAC9F,MAAM,CAAC,MAAM,QAAQ,GAAsC,cAAc,CAAC;IACtE,GAAG,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;IAC7C,MAAM,EAAE,EAAE,EAAE,EAAE,mCAAmC,EAAE;IACnD,IAAI,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE;IAC/C,KAAK,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE;IACjD,KAAK,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE;IACjD,MAAM,EAAE,EAAE,EAAE,EAAE,mCAAmC,EAAE;IACnD,IAAI,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE;IAC/C,IAAI,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE;IAC/C,KAAK,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE;
|
|
1
|
+
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../src/locales.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D,8FAA8F;AAC9F,MAAM,CAAC,MAAM,QAAQ,GAAsC,cAAc,CAAC;IACtE,GAAG,EAAE,EAAE,EAAE,EAAE,gCAAgC,EAAE;IAC7C,MAAM,EAAE,EAAE,EAAE,EAAE,mCAAmC,EAAE;IACnD,IAAI,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE;IAC/C,KAAK,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE;IACjD,KAAK,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE;IACjD,MAAM,EAAE,EAAE,EAAE,EAAE,mCAAmC,EAAE;IACnD,IAAI,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE;IAC/C,IAAI,EAAE,EAAE,EAAE,EAAE,iCAAiC,EAAE;IAC/C,KAAK,EAAE,EAAE,EAAE,EAAE,kCAAkC,EAAE;CACpD,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddata/sdk-ui-vis-commons",
|
|
3
|
-
"version": "10.24.0-alpha.
|
|
3
|
+
"version": "10.24.0-alpha.2",
|
|
4
4
|
"description": "GoodData.UI SDK - common functionality for different types of visualizations",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"react-intl": "^6.4.1",
|
|
37
37
|
"react-measure": "^2.5.2",
|
|
38
38
|
"tslib": "^2.5.0",
|
|
39
|
-
"@gooddata/sdk-backend-spi": "10.24.0-alpha.
|
|
40
|
-
"@gooddata/sdk-model": "10.24.0-alpha.
|
|
41
|
-
"@gooddata/sdk-ui": "10.24.0-alpha.
|
|
42
|
-
"@gooddata/sdk-ui
|
|
43
|
-
"@gooddata/sdk-ui-theme-provider": "10.24.0-alpha.
|
|
39
|
+
"@gooddata/sdk-backend-spi": "10.24.0-alpha.2",
|
|
40
|
+
"@gooddata/sdk-model": "10.24.0-alpha.2",
|
|
41
|
+
"@gooddata/sdk-ui-kit": "10.24.0-alpha.2",
|
|
42
|
+
"@gooddata/sdk-ui": "10.24.0-alpha.2",
|
|
43
|
+
"@gooddata/sdk-ui-theme-provider": "10.24.0-alpha.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "^16.10.0 || ^17.0.0 || ^18.0.0",
|
|
@@ -85,8 +85,8 @@
|
|
|
85
85
|
"typescript": "5.3.3",
|
|
86
86
|
"vitest": "3.0.8",
|
|
87
87
|
"vitest-dom": "0.1.1",
|
|
88
|
-
"@gooddata/
|
|
89
|
-
"@gooddata/
|
|
88
|
+
"@gooddata/reference-workspace": "10.24.0-alpha.2",
|
|
89
|
+
"@gooddata/sdk-backend-mockingbird": "10.24.0-alpha.2"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"clean": "rm -rf ci dist esm coverage styles/css *.log tsconfig.tsbuildinfo",
|
package/styles/scss/legend.scss
CHANGED
|
@@ -51,17 +51,6 @@ $legend-content-background: var(--gd-chart-backgroundColor, var(--gd-palette-com
|
|
|
51
51
|
text-align: left;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.series-item {
|
|
55
|
-
background: none;
|
|
56
|
-
border: none;
|
|
57
|
-
padding: 0;
|
|
58
|
-
margin: 0;
|
|
59
|
-
text-align: left;
|
|
60
|
-
&:focus-visible {
|
|
61
|
-
outline: auto;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
|
|
65
54
|
.series-item,
|
|
66
55
|
.series-axis-indicator {
|
|
67
56
|
display: flex;
|
|
@@ -107,10 +96,6 @@ $legend-content-background: var(--gd-chart-backgroundColor, var(--gd-palette-com
|
|
|
107
96
|
padding: 0;
|
|
108
97
|
border-radius: 50%;
|
|
109
98
|
|
|
110
|
-
&:focus-visible {
|
|
111
|
-
outline: auto;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
99
|
&::before {
|
|
115
100
|
font-size: 11px;
|
|
116
101
|
}
|