@widergy/energy-ui 3.54.1 → 3.56.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/CHANGELOG.md +14 -0
- package/dist/components/UTHeader/index.js +2 -2
- package/dist/components/UTTable/components/TableHeader/index.js +13 -6
- package/dist/components/UTTable/index.js +5 -2
- package/dist/components/UTTabs/index.js +7 -2
- package/dist/constants/testIds.js +5 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.56.0](https://github.com/widergy/energy-ui/compare/v3.55.0...v3.56.0) (2025-01-28)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [AUT-414] payment history id ([#564](https://github.com/widergy/energy-ui/issues/564)) ([df378e8](https://github.com/widergy/energy-ui/commit/df378e88a3cca6fa6feaf4fd11ee0d5b568f53ec))
|
|
7
|
+
|
|
8
|
+
# [3.55.0](https://github.com/widergy/energy-ui/compare/v3.54.1...v3.55.0) (2025-01-27)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* [UGC-578] shopping cart ([#565](https://github.com/widergy/energy-ui/issues/565)) ([4ffa165](https://github.com/widergy/energy-ui/commit/4ffa165527b025fedc8bcd28505d85a4a6cebff7))
|
|
14
|
+
|
|
1
15
|
## [3.54.1](https://github.com/widergy/energy-ui/compare/v3.54.0...v3.54.1) (2025-01-27)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -119,12 +119,12 @@ const UTHeader = _ref => {
|
|
|
119
119
|
className: classes.titleIcon
|
|
120
120
|
}), Title, !(0, _isEmpty.default)(actions) && /*#__PURE__*/_react.default.createElement("div", {
|
|
121
121
|
className: _stylesModule.default.actionsContainer
|
|
122
|
-
}, mainAction && /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
122
|
+
}, mainAction && (mainAction.Component ? /*#__PURE__*/_react.default.createElement(mainAction.Component, null) : /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
123
123
|
colorTheme: "primary",
|
|
124
124
|
Icon: MainIcon,
|
|
125
125
|
onClick: mainAction.onClick,
|
|
126
126
|
variant: "text"
|
|
127
|
-
}), !(0, _isEmpty.default)(moreActions) && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
127
|
+
})), !(0, _isEmpty.default)(moreActions) && /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
128
128
|
onClick: openMenu,
|
|
129
129
|
variant: "text",
|
|
130
130
|
Icon: Ellipsis
|
|
@@ -9,6 +9,7 @@ var _propTypes = require("prop-types");
|
|
|
9
9
|
var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
10
10
|
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
11
11
|
var _types = require("../../types");
|
|
12
|
+
var _testIds = require("../../../../constants/testIds");
|
|
12
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
14
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
15
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -26,22 +27,27 @@ RefreshIcon.defaultProps = {
|
|
|
26
27
|
viewBox: "0 0 18 18",
|
|
27
28
|
xmlns: "http://www.w3.org/2000/svg"
|
|
28
29
|
};
|
|
30
|
+
const {
|
|
31
|
+
titleId
|
|
32
|
+
} = _testIds.COMPONENT_IDS.tableIds;
|
|
29
33
|
const TableHeader = _ref => {
|
|
30
34
|
let {
|
|
31
35
|
classes,
|
|
36
|
+
disabled,
|
|
37
|
+
GeneralActions,
|
|
32
38
|
onReload,
|
|
33
39
|
title,
|
|
34
|
-
|
|
35
|
-
disabled
|
|
40
|
+
titleDataTestId
|
|
36
41
|
} = _ref;
|
|
37
42
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
38
43
|
className: "".concat(_stylesModule.default.header, " ").concat(classes.headerContainer)
|
|
39
44
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
40
45
|
className: _stylesModule.default.titleContainer
|
|
41
46
|
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
47
|
+
className: classes.tableTitle,
|
|
48
|
+
dataTestId: titleDataTestId !== null && titleDataTestId !== void 0 ? titleDataTestId : titleId,
|
|
42
49
|
variant: "subtitle1",
|
|
43
|
-
weight: "medium"
|
|
44
|
-
className: classes.tableTitle
|
|
50
|
+
weight: "medium"
|
|
45
51
|
}, title), onReload && /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
46
52
|
classNames: {
|
|
47
53
|
icon: "".concat(_stylesModule.default.reloadIcon, " ").concat(classes.reloadIcon),
|
|
@@ -54,9 +60,10 @@ const TableHeader = _ref => {
|
|
|
54
60
|
};
|
|
55
61
|
TableHeader.propTypes = {
|
|
56
62
|
classes: _types.classesType,
|
|
63
|
+
disabled: _propTypes.bool,
|
|
64
|
+
GeneralActions: _propTypes.node,
|
|
57
65
|
onReload: _propTypes.func,
|
|
58
66
|
title: _propTypes.string,
|
|
59
|
-
|
|
60
|
-
disabled: _propTypes.bool
|
|
67
|
+
titleDataTestId: _propTypes.string
|
|
61
68
|
};
|
|
62
69
|
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(TableHeader);
|
|
@@ -84,6 +84,7 @@ const UTTable = _ref => {
|
|
|
84
84
|
stickyHeader,
|
|
85
85
|
tableTitle,
|
|
86
86
|
tabletBreakpoint = _constants.DEFAULT_TABLET_BREAKPOINT,
|
|
87
|
+
titleDataTestId,
|
|
87
88
|
totalRows,
|
|
88
89
|
totalRowsLabel
|
|
89
90
|
} = _ref;
|
|
@@ -247,7 +248,7 @@ const UTTable = _ref => {
|
|
|
247
248
|
rowKey: rowKey,
|
|
248
249
|
rowStyles: rowStyles,
|
|
249
250
|
selectable: selectable,
|
|
250
|
-
selectionComponentDataTestId: selectionComponentDataTestId !== null && selectionComponentDataTestId !== void 0 ? selectionComponentDataTestId : "".concat(_testIds.TABLE, ".").concat(_testIds.TABLE_ROW, ".").concat(_testIds.CELL, ".").concat(_testIds.SELECTION_COMPONENT),
|
|
251
|
+
selectionComponentDataTestId: selectionComponentDataTestId !== null && selectionComponentDataTestId !== void 0 ? selectionComponentDataTestId : "".concat(_testIds.TABLE, ".").concat(_testIds.TABLE_ROW, ".row_").concat(index, ".").concat(_testIds.CELL, ".").concat(_testIds.SELECTION_COMPONENT),
|
|
251
252
|
selectedRows: selectedRows,
|
|
252
253
|
tableSize: tableWidth
|
|
253
254
|
});
|
|
@@ -295,7 +296,8 @@ const UTTable = _ref => {
|
|
|
295
296
|
disabled: disableReloadRows,
|
|
296
297
|
GeneralActions: GeneralActions,
|
|
297
298
|
onReload: onReloadRows,
|
|
298
|
-
title: tableTitle
|
|
299
|
+
title: tableTitle,
|
|
300
|
+
titleDataTestId: titleDataTestId
|
|
299
301
|
}), Filters, !isResponsive && /*#__PURE__*/_react.default.createElement("div", {
|
|
300
302
|
className: stickyHeader && "".concat(_stylesModule.default.stickyHeader, " ").concat(classes.stickyHeader || '')
|
|
301
303
|
}, /*#__PURE__*/_react.default.createElement(_reactPerfectScrollbar.default, {
|
|
@@ -377,6 +379,7 @@ UTTable.propTypes = {
|
|
|
377
379
|
stickyHeader: _propTypes.bool,
|
|
378
380
|
tableTitle: _propTypes.string,
|
|
379
381
|
tabletBreakpoint: _propTypes.number,
|
|
382
|
+
titleDataTestId: _propTypes.string,
|
|
380
383
|
totalRows: _propTypes.number,
|
|
381
384
|
totalRowsLabel: _propTypes.string
|
|
382
385
|
};
|
|
@@ -10,6 +10,7 @@ var _Tab = _interopRequireDefault(require("@material-ui/core/Tab"));
|
|
|
10
10
|
var _propTypes = require("prop-types");
|
|
11
11
|
var _array = require("@widergy/web-utils/lib/array");
|
|
12
12
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
13
|
+
var _testIds = require("../../constants/testIds");
|
|
13
14
|
var _classesUtils = require("../../utils/classesUtils");
|
|
14
15
|
var _TooltipTab = _interopRequireDefault(require("./components/TooltipTab"));
|
|
15
16
|
var _constants = require("./constants");
|
|
@@ -23,6 +24,9 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
23
24
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
24
25
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
25
26
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
27
|
+
const {
|
|
28
|
+
tabId
|
|
29
|
+
} = _testIds.COMPONENT_IDS.tabsIds;
|
|
26
30
|
class UTTabs extends _react.PureComponent {
|
|
27
31
|
constructor() {
|
|
28
32
|
super(...arguments);
|
|
@@ -52,7 +56,7 @@ class UTTabs extends _react.PureComponent {
|
|
|
52
56
|
className: "".concat(styles.indicator, " ").concat(classes.indicator),
|
|
53
57
|
children: /*#__PURE__*/_react.default.createElement("div", null)
|
|
54
58
|
}
|
|
55
|
-
}, tabsProps), options.map(opt => {
|
|
59
|
+
}, tabsProps), options.map((opt, i) => {
|
|
56
60
|
const tabComponent = opt.tooltip ? /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/_react.default.createElement(_TooltipTab.default, _extends({}, props, {
|
|
57
61
|
buttonRef: ref,
|
|
58
62
|
isDisabled: opt.disabled,
|
|
@@ -71,7 +75,8 @@ class UTTabs extends _react.PureComponent {
|
|
|
71
75
|
label: opt.label,
|
|
72
76
|
disabled: opt.disabled,
|
|
73
77
|
icon: opt.icon,
|
|
74
|
-
component: tabComponent
|
|
78
|
+
component: tabComponent,
|
|
79
|
+
"data-testid": tabProps !== null && tabProps !== void 0 && tabProps.dataTestId ? "".concat(tabProps === null || tabProps === void 0 ? void 0 : tabProps.dataTestId).concat(i) : "".concat(tabId).concat(i)
|
|
75
80
|
}, tabProps));
|
|
76
81
|
}), !(0, _array.isEmpty)(badges) && badges.map(badge => /*#__PURE__*/_react.default.createElement("div", {
|
|
77
82
|
className: "".concat(badge.styles, " ").concat(!badge.show && _stylesModule.default.hiddenBadge)
|
|
@@ -30,7 +30,11 @@ const COMPONENT_IDS = exports.COMPONENT_IDS = {
|
|
|
30
30
|
tableIds: {
|
|
31
31
|
actionsId: "".concat(TABLE, ".actions"),
|
|
32
32
|
cellId: "".concat(TABLE, ".tableRow.cell"),
|
|
33
|
-
selectionComponentId: "".concat(TABLE, ".tableRow.selectionComponent")
|
|
33
|
+
selectionComponentId: "".concat(TABLE, ".tableRow.selectionComponent"),
|
|
34
|
+
titleId: "".concat(TABLE, ".tableHeader.title")
|
|
35
|
+
},
|
|
36
|
+
tabsIds: {
|
|
37
|
+
tabId: 'tabs.tab.'
|
|
34
38
|
},
|
|
35
39
|
workflowContainerIds: {
|
|
36
40
|
backButtonId: "".concat(WORKFLOW_CONTAINER, ".").concat(BOTTOM_NAV, ".backButton"),
|