@widergy/energy-ui 2.5.2 → 2.5.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/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
## [2.5.4](https://github.com/widergy/energy-ui/compare/v2.5.3...v2.5.4) (2023-08-31)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* add overflow control capabilities ([b1c20ba](https://github.com/widergy/energy-ui/commit/b1c20ba52e697689661353c361cab04986bfdcf8))
|
|
7
|
+
* conflict solving ([7f7a930](https://github.com/widergy/energy-ui/commit/7f7a930486eee58a0fa7407b61325ab7de939f79))
|
|
8
|
+
|
|
9
|
+
## [2.5.3](https://github.com/widergy/energy-ui/compare/v2.5.2...v2.5.3) (2023-08-31)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* add a function to remove size event listener ([6e36b9f](https://github.com/widergy/energy-ui/commit/6e36b9f81c9a11c20bed41c72152de34502bbf90))
|
|
15
|
+
|
|
1
16
|
## [2.5.2](https://github.com/widergy/energy-ui/compare/v2.5.1...v2.5.2) (2023-08-30)
|
|
2
17
|
|
|
3
18
|
|
|
@@ -41,6 +41,8 @@ var UTBreadcrumbs = function UTBreadcrumbs(_ref) {
|
|
|
41
41
|
elipsis = _ref$elipsis === void 0 ? _constants.DEFAULT_ELIPSIS : _ref$elipsis,
|
|
42
42
|
_ref$elipsisWidthEsti = _ref.elipsisWidthEstimate,
|
|
43
43
|
elipsisWidthEstimate = _ref$elipsisWidthEsti === void 0 ? _constants.DEFAULT_ELIPSIS_WIDTH_ESTIMATE : _ref$elipsisWidthEsti,
|
|
44
|
+
_ref$firstItemOverflo = _ref.firstItemOverflow,
|
|
45
|
+
firstItemOverflow = _ref$firstItemOverflo === void 0 ? false : _ref$firstItemOverflo,
|
|
44
46
|
_ref$menuProps = _ref.menuProps,
|
|
45
47
|
menuProps = _ref$menuProps === void 0 ? {} : _ref$menuProps,
|
|
46
48
|
onRedirect = _ref.onRedirect,
|
|
@@ -147,16 +149,19 @@ var UTBreadcrumbs = function UTBreadcrumbs(_ref) {
|
|
|
147
149
|
});else onRedirect(route);
|
|
148
150
|
};
|
|
149
151
|
var isLast = index === content.length - 1;
|
|
152
|
+
var overflowControl = index === 0 && firstItemOverflow;
|
|
150
153
|
var colorThemesDefinition = buttonColorTheme ? _constants.COMPONENTS_THEME_PROPS[_constants.COLOR_THEMES_MAPPER[buttonColorTheme]] : _constants.COMPONENTS_THEME_PROPS[colorTheme];
|
|
151
154
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
152
|
-
className: _stylesModule.default.section,
|
|
155
|
+
className: "".concat(_stylesModule.default.section, " ").concat(overflowControl && _stylesModule.default.firstItem),
|
|
153
156
|
key: "".concat(route, "-").concat(label)
|
|
154
157
|
}, !route && !menuItems || disableMenu ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
|
|
155
158
|
className: _stylesModule.default.label,
|
|
156
159
|
weight: "medium"
|
|
157
160
|
}, colorThemesDefinition.label), label) : /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
158
161
|
classNames: {
|
|
159
|
-
root: itemClassName
|
|
162
|
+
root: itemClassName,
|
|
163
|
+
childrenContainer: overflowControl ? _stylesModule.default.buttonContainer : null,
|
|
164
|
+
text: overflowControl ? _stylesModule.default.ellipsis : null
|
|
160
165
|
},
|
|
161
166
|
onClick: handleClick,
|
|
162
167
|
size: "small",
|
|
@@ -183,6 +188,7 @@ UTBreadcrumbs.propTypes = {
|
|
|
183
188
|
disableMenu: _propTypes.bool,
|
|
184
189
|
elipsis: _propTypes.string,
|
|
185
190
|
elipsisWidthEstimate: _propTypes.number,
|
|
191
|
+
firstItemOverflow: _propTypes.bool,
|
|
186
192
|
onRedirect: _propTypes.func,
|
|
187
193
|
menuProps: _propTypes.object,
|
|
188
194
|
separator: _propTypes.string
|
|
@@ -40,9 +40,10 @@ var UTConsumptionBar = function UTConsumptionBar(_ref) {
|
|
|
40
40
|
};
|
|
41
41
|
(0, _react.useEffect)(function () {
|
|
42
42
|
window.addEventListener('resize', handleSetShowLabel);
|
|
43
|
-
});
|
|
44
|
-
(0, _react.useEffect)(function () {
|
|
45
43
|
handleSetShowLabel();
|
|
44
|
+
return function () {
|
|
45
|
+
return window.removeEventListener('resize', handleSetShowLabel);
|
|
46
|
+
};
|
|
46
47
|
}, []);
|
|
47
48
|
var downIndicators = values.filter(function (value) {
|
|
48
49
|
return value.position === _constants.DOWN;
|