@widergy/energy-ui 3.71.0 → 3.71.1
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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.71.1](https://github.com/widergy/energy-ui/compare/v3.71.0...v3.71.1) (2025-05-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* visual fixes on chart legends ([#612](https://github.com/widergy/energy-ui/issues/612)) ([657129a](https://github.com/widergy/energy-ui/commit/657129a7a743dcc27953de2056e1d15adde2ec51))
|
|
7
|
+
|
|
1
8
|
# [3.71.0](https://github.com/widergy/energy-ui/compare/v3.70.0...v3.71.0) (2025-05-05)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -3,21 +3,6 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var _reactPerfectScrollbar = _interopRequireDefault(require("react-perfect-scrollbar"));
|
|
8
|
-
var _UTDialog = _interopRequireDefault(require("../../../UTDialog"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
6
|
+
exports.MODAL_KEY = exports.BLOCK_KEY = void 0;
|
|
10
7
|
const BLOCK_KEY = exports.BLOCK_KEY = 'block';
|
|
11
|
-
const MODAL_KEY = exports.MODAL_KEY = 'modal';
|
|
12
|
-
const options = {
|
|
13
|
-
[BLOCK_KEY]: {
|
|
14
|
-
Component: _reactPerfectScrollbar.default,
|
|
15
|
-
withButton: false
|
|
16
|
-
},
|
|
17
|
-
[MODAL_KEY]: {
|
|
18
|
-
Component: _UTDialog.default,
|
|
19
|
-
withButton: true
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
const displayOptions = displayAs => options[displayAs] || options[BLOCK_KEY];
|
|
23
|
-
exports.displayOptions = displayOptions;
|
|
8
|
+
const MODAL_KEY = exports.MODAL_KEY = 'modal';
|
|
@@ -44,10 +44,6 @@ const Legend = _ref => {
|
|
|
44
44
|
linear: flatLinearData = [],
|
|
45
45
|
levels = []
|
|
46
46
|
} = flatData || {};
|
|
47
|
-
const {
|
|
48
|
-
Component: Wrapper,
|
|
49
|
-
withButton
|
|
50
|
-
} = (0, _constants.displayOptions)(displayAs);
|
|
51
47
|
const getReferencesToShow = () => {
|
|
52
48
|
let referencesToShow = new Set();
|
|
53
49
|
flatBarData.forEach(item => barReferences.forEach(_ref2 => {
|
|
@@ -97,23 +93,11 @@ const Legend = _ref => {
|
|
|
97
93
|
};
|
|
98
94
|
const referencesToShow = getReferencesToShow(flatData);
|
|
99
95
|
const hasReferences = !(0, _array.isEmpty)(referencesToShow);
|
|
100
|
-
const wrapperProps = displayAs === _constants.MODAL_KEY ? {
|
|
101
|
-
acceptButton: {
|
|
102
|
-
onClick: () => setShowLegend(false),
|
|
103
|
-
text: referencesModalButton || ''
|
|
104
|
-
},
|
|
105
|
-
isOpen: showLegend,
|
|
106
|
-
onRequestClose: () => setShowLegend(false),
|
|
107
|
-
title: referencesModalTitle,
|
|
108
|
-
withCloseButton: true
|
|
109
|
-
} : {
|
|
110
|
-
className: _stylesModule.default.scrollbar
|
|
111
|
-
};
|
|
112
96
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
113
97
|
style: style
|
|
114
98
|
}, title && /*#__PURE__*/_react.default.createElement(_.UTLabel, {
|
|
115
99
|
className: "".concat(_stylesModule.default.title, " ").concat(classes.title)
|
|
116
|
-
}, title),
|
|
100
|
+
}, title), displayAs === _constants.MODAL_KEY ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement(_.UTButton, _extends({
|
|
117
101
|
classNames: {
|
|
118
102
|
icon: classes.showLegendIcon,
|
|
119
103
|
root: "".concat(_stylesModule.default.button, " ").concat(classes.showLegendButton),
|
|
@@ -122,14 +106,25 @@ const Legend = _ref => {
|
|
|
122
106
|
disabled: !hasReferences,
|
|
123
107
|
Icon: _InfoOutlined.default,
|
|
124
108
|
onClick: () => setShowLegend(true)
|
|
125
|
-
}, buttonProps), showReferencesLabel), /*#__PURE__*/_react.default.createElement(
|
|
126
|
-
|
|
127
|
-
|
|
109
|
+
}, buttonProps), showReferencesLabel), /*#__PURE__*/_react.default.createElement(_.UTDialog, {
|
|
110
|
+
acceptButton: {
|
|
111
|
+
onClick: () => setShowLegend(false),
|
|
112
|
+
text: referencesModalButton || ''
|
|
113
|
+
},
|
|
114
|
+
isOpen: showLegend,
|
|
115
|
+
onRequestClose: () => setShowLegend(false),
|
|
116
|
+
title: referencesModalTitle,
|
|
117
|
+
withCloseButton: true
|
|
118
|
+
}, referencesToShow.map(row => /*#__PURE__*/_react.default.createElement("div", {
|
|
119
|
+
className: _stylesModule.default.rowmodal
|
|
120
|
+
}, row.map(item => referenceRenderer(item)))))) : /*#__PURE__*/_react.default.createElement("div", {
|
|
121
|
+
className: _stylesModule.default.referencesContainer
|
|
122
|
+
}, referencesToShow.map(row => row.map(item => referenceRenderer(item)))));
|
|
128
123
|
};
|
|
129
124
|
Legend.propTypes = {
|
|
130
125
|
buttonProps: _types.buttonPropsTypes,
|
|
131
126
|
classes: _commonTypes.classesType,
|
|
132
|
-
displayAs: _propTypes.
|
|
127
|
+
displayAs: (0, _propTypes.oneOf)([_constants.BLOCK_KEY, _constants.MODAL_KEY]),
|
|
133
128
|
flatData: (0, _propTypes.shape)({
|
|
134
129
|
bar: (0, _propTypes.arrayOf)(_types.barType),
|
|
135
130
|
linear: (0, _propTypes.arrayOf)(_types.linearType),
|
|
@@ -3,17 +3,16 @@
|
|
|
3
3
|
width: fit-content;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
6
|
+
.referencesContainer {
|
|
7
|
+
align-items: center;
|
|
7
8
|
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
grid-gap: 16px;
|
|
8
11
|
}
|
|
9
12
|
|
|
10
13
|
.itemblock {
|
|
11
14
|
align-items: center;
|
|
12
15
|
display: flex;
|
|
13
|
-
|
|
14
|
-
& + div {
|
|
15
|
-
margin-left: 16px;
|
|
16
|
-
}
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
.itemmodal {
|
|
@@ -21,7 +20,7 @@
|
|
|
21
20
|
display: flex;
|
|
22
21
|
|
|
23
22
|
& + div {
|
|
24
|
-
margin-top:
|
|
23
|
+
margin-top: 16px;
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
|
|
@@ -29,21 +28,12 @@
|
|
|
29
28
|
white-space: nowrap;
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
.rowblock {
|
|
33
|
-
align-items: center;
|
|
34
|
-
display: flex;
|
|
35
|
-
|
|
36
|
-
& + div {
|
|
37
|
-
margin-left: 15px;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
31
|
.rowmodal {
|
|
42
32
|
display: flex;
|
|
43
33
|
flex-direction: column;
|
|
44
34
|
|
|
45
35
|
& + div {
|
|
46
|
-
margin-top:
|
|
36
|
+
margin-top: 16px;
|
|
47
37
|
}
|
|
48
38
|
}
|
|
49
39
|
|