@widergy/energy-ui 3.63.2 → 3.64.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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [3.64.0](https://github.com/widergy/energy-ui/compare/v3.63.2...v3.64.0) (2025-02-24)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [AUT-500] panel ids ([#578](https://github.com/widergy/energy-ui/issues/578)) ([6d80159](https://github.com/widergy/energy-ui/commit/6d8015945a4653a38c644d29fe3cce98c848c712))
|
|
7
|
+
|
|
1
8
|
## [3.63.2](https://github.com/widergy/energy-ui/compare/v3.63.1...v3.63.2) (2025-02-24)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -12,14 +12,20 @@ var _Close = _interopRequireDefault(require("@material-ui/icons/Close"));
|
|
|
12
12
|
var _propTypes = require("prop-types");
|
|
13
13
|
var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
14
14
|
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
15
|
+
var _testIds = require("../../../../constants/testIds");
|
|
15
16
|
var _commonTypes = require("../../../../types/commonTypes");
|
|
16
17
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
18
19
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
20
|
+
const {
|
|
21
|
+
closeButtonId,
|
|
22
|
+
titleId
|
|
23
|
+
} = _testIds.COMPONENT_IDS.panelIds;
|
|
19
24
|
const UTPanel = _ref => {
|
|
20
25
|
let {
|
|
21
26
|
children,
|
|
22
27
|
classes = {},
|
|
28
|
+
closeButtonDataTestId = closeButtonId,
|
|
23
29
|
containerRef,
|
|
24
30
|
disableScrollbar = false,
|
|
25
31
|
modalProps,
|
|
@@ -31,6 +37,7 @@ const UTPanel = _ref => {
|
|
|
31
37
|
perfectScrollbarOptions,
|
|
32
38
|
title,
|
|
33
39
|
TitleComponent,
|
|
40
|
+
titleDataTestId = titleId,
|
|
34
41
|
TitleIcon,
|
|
35
42
|
...props
|
|
36
43
|
} = _ref;
|
|
@@ -67,13 +74,15 @@ const UTPanel = _ref => {
|
|
|
67
74
|
}, TitleIcon && /*#__PURE__*/_react.default.createElement(TitleIcon, {
|
|
68
75
|
className: "".concat(_stylesModule.default.titleIcon, " ").concat(titleIconClass)
|
|
69
76
|
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
70
|
-
|
|
71
|
-
|
|
77
|
+
className: classes.title,
|
|
78
|
+
dataTestId: titleDataTestId,
|
|
79
|
+
weight: "semibold"
|
|
72
80
|
}, title)), /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
73
81
|
classNames: {
|
|
74
82
|
icon: iconCloseClass,
|
|
75
83
|
root: closeButtonClass
|
|
76
84
|
},
|
|
85
|
+
dataTestId: closeButtonDataTestId,
|
|
77
86
|
Icon: _Close.default,
|
|
78
87
|
onClick: onClose,
|
|
79
88
|
variant: "text"
|
|
@@ -88,6 +97,7 @@ const UTPanel = _ref => {
|
|
|
88
97
|
};
|
|
89
98
|
UTPanel.propTypes = {
|
|
90
99
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
100
|
+
closeButtonDataTestId: _propTypes.string,
|
|
91
101
|
containerRef: _commonTypes.refType,
|
|
92
102
|
disableScrollbar: _propTypes.bool,
|
|
93
103
|
modalProps: _propTypes.object,
|
|
@@ -99,6 +109,7 @@ UTPanel.propTypes = {
|
|
|
99
109
|
perfectScrollbarOptions: _propTypes.object,
|
|
100
110
|
title: _propTypes.string,
|
|
101
111
|
TitleComponent: (0, _propTypes.oneOfType)([_propTypes.element, _propTypes.elementType]),
|
|
112
|
+
titleDataTestId: _propTypes.string,
|
|
102
113
|
TitleIcon: _propTypes.elementType
|
|
103
114
|
};
|
|
104
115
|
var _default = exports.default = UTPanel;
|
|
@@ -15,8 +15,9 @@ var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
|
15
15
|
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
16
16
|
var _UTMenu = _interopRequireDefault(require("../../../UTMenu"));
|
|
17
17
|
var _index = _interopRequireDefault(require("../../../UTProgressBar/index.js"));
|
|
18
|
-
var _classesUtils = require("../../../../utils/classesUtils.js");
|
|
19
18
|
var _index2 = _interopRequireDefault(require("../../../WithTheme/index.js"));
|
|
19
|
+
var _testIds = require("../../../../constants/testIds.js");
|
|
20
|
+
var _classesUtils = require("../../../../utils/classesUtils.js");
|
|
20
21
|
var _DataItem = _interopRequireDefault(require("./components/DataItem"));
|
|
21
22
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
22
23
|
var _constants = require("./constants.js");
|
|
@@ -25,11 +26,18 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
25
26
|
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
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
27
28
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
29
|
+
const {
|
|
30
|
+
closeButtonId,
|
|
31
|
+
mainActionId,
|
|
32
|
+
secondaryActionId,
|
|
33
|
+
titleId
|
|
34
|
+
} = _testIds.COMPONENT_IDS.panelIds;
|
|
28
35
|
const UTPanel = _ref => {
|
|
29
36
|
let {
|
|
30
37
|
children,
|
|
31
|
-
classes: theme,
|
|
32
38
|
classNames,
|
|
39
|
+
classes: theme,
|
|
40
|
+
closeButtonDataTestId = closeButtonId,
|
|
33
41
|
collapsableHeader = false,
|
|
34
42
|
currentStep = 1,
|
|
35
43
|
disableScrollbar = false,
|
|
@@ -41,6 +49,7 @@ const UTPanel = _ref => {
|
|
|
41
49
|
hideHeader = false,
|
|
42
50
|
hideMainButton = false,
|
|
43
51
|
isWorkflow = false,
|
|
52
|
+
mainActionDataTestId = mainActionId,
|
|
44
53
|
mainButton = {},
|
|
45
54
|
modalProps,
|
|
46
55
|
onClose,
|
|
@@ -49,11 +58,13 @@ const UTPanel = _ref => {
|
|
|
49
58
|
open,
|
|
50
59
|
panelSide,
|
|
51
60
|
perfectScrollbarOptions,
|
|
61
|
+
secondaryActionDataTestId = secondaryActionId,
|
|
52
62
|
singleHeaderItemsColumn = false,
|
|
53
63
|
size = 'M',
|
|
54
64
|
stepsCount,
|
|
55
65
|
subtitle = '',
|
|
56
66
|
title = '',
|
|
67
|
+
titleDataTestId = titleId,
|
|
57
68
|
titleProps = {},
|
|
58
69
|
...props
|
|
59
70
|
} = _ref;
|
|
@@ -95,6 +106,7 @@ const UTPanel = _ref => {
|
|
|
95
106
|
icon: iconCloseClass,
|
|
96
107
|
root: closeButtonClass
|
|
97
108
|
},
|
|
109
|
+
dataTestId: closeButtonDataTestId,
|
|
98
110
|
Icon: "IconX",
|
|
99
111
|
onClick: onClose,
|
|
100
112
|
variant: "text"
|
|
@@ -115,6 +127,7 @@ const UTPanel = _ref => {
|
|
|
115
127
|
className: _stylesModule.default.titleArea
|
|
116
128
|
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
|
|
117
129
|
className: classes.title,
|
|
130
|
+
dataTestId: titleDataTestId,
|
|
118
131
|
variant: "title2",
|
|
119
132
|
weight: "medium"
|
|
120
133
|
}, titleProps), title), collapsableHeader && /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
@@ -138,10 +151,12 @@ const UTPanel = _ref => {
|
|
|
138
151
|
withMenuItem: true
|
|
139
152
|
}), /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
140
153
|
colorTheme: "primary",
|
|
154
|
+
dataTestId: secondaryActionDataTestId,
|
|
141
155
|
onClick: secondaryActionAsMenu ? openMenu : undefined,
|
|
142
156
|
variant: "semitransparent"
|
|
143
157
|
}, !secondaryActionAsMenu && headerSecondaryActionButton), secondaryActionAsMenu ? _constants.MENU_LABEL : headerSecondaryActionButton.text)), !(0, _isEmpty.default)(headerMainActionButton) && /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
144
158
|
colorTheme: "success",
|
|
159
|
+
dataTestId: mainActionDataTestId,
|
|
145
160
|
variant: "filled"
|
|
146
161
|
}, headerMainActionButton), headerMainActionButton.text)))), !(0, _isEmpty.default)(headerItems) && /*#__PURE__*/_react.default.createElement("div", {
|
|
147
162
|
className: "".concat(_stylesModule.default.headerItemsContainer, " \n ").concat(collapseHeader ? _stylesModule.default.expandedContainer : _stylesModule.default.collapsedContainer, " \n ").concat(singleHeaderItemsColumn && _stylesModule.default.singleHeaderItemsColumn || '')
|
|
@@ -162,8 +177,9 @@ const UTPanel = _ref => {
|
|
|
162
177
|
}, mainButton), (mainButton === null || mainButton === void 0 ? void 0 : mainButton.text) || _constants.ACCEPT_BUTTON_TEXT));
|
|
163
178
|
};
|
|
164
179
|
UTPanel.propTypes = {
|
|
165
|
-
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
166
180
|
classNames: _propTypes.object,
|
|
181
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
182
|
+
closeButtonDataTestId: _propTypes.string,
|
|
167
183
|
collapsableHeader: _propTypes.bool,
|
|
168
184
|
currentStep: _propTypes.number,
|
|
169
185
|
disableScrollbar: _propTypes.bool,
|
|
@@ -185,7 +201,11 @@ UTPanel.propTypes = {
|
|
|
185
201
|
text: _propTypes.string,
|
|
186
202
|
variant: _propTypes.string
|
|
187
203
|
}),
|
|
204
|
+
hideCloseButton: _propTypes.bool,
|
|
205
|
+
hideHeader: _propTypes.bool,
|
|
206
|
+
hideMainButton: _propTypes.bool,
|
|
188
207
|
isWorkflow: _propTypes.bool,
|
|
208
|
+
mainActionDataTestId: _propTypes.string,
|
|
189
209
|
mainButton: _propTypes.object,
|
|
190
210
|
modalProps: _propTypes.object,
|
|
191
211
|
onClose: _propTypes.func,
|
|
@@ -194,14 +214,13 @@ UTPanel.propTypes = {
|
|
|
194
214
|
open: _propTypes.bool,
|
|
195
215
|
panelSide: _propTypes.string,
|
|
196
216
|
perfectScrollbarOptions: _propTypes.object,
|
|
197
|
-
|
|
198
|
-
hideMainButton: _propTypes.bool,
|
|
199
|
-
hideHeader: _propTypes.bool,
|
|
217
|
+
secondaryActionDataTestId: _propTypes.string,
|
|
200
218
|
singleHeaderItemsColumn: _propTypes.bool,
|
|
201
219
|
size: _propTypes.string,
|
|
202
220
|
stepsCount: _propTypes.number,
|
|
203
221
|
subtitle: _propTypes.string,
|
|
204
222
|
title: _propTypes.string,
|
|
223
|
+
titleDataTestId: _propTypes.string,
|
|
205
224
|
titleProps: _propTypes.object
|
|
206
225
|
};
|
|
207
226
|
var _default = exports.default = (0, _index2.default)(_theme.retrieveStyle)(UTPanel);
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TABLE_ROW = exports.TABLE = exports.STATUS_MESSAGE = exports.SELECTION_COMPONENT = exports.HEADER = exports.CREDIT_CARD = exports.COMPONENT_IDS = exports.CELL = exports.ACTIONS = void 0;
|
|
6
|
+
exports.TABLE_ROW = exports.TABLE = exports.STATUS_MESSAGE = exports.SELECTION_COMPONENT = exports.PANEL = exports.HEADER = exports.CREDIT_CARD = exports.COMPONENT_IDS = exports.CELL = exports.ACTIONS = void 0;
|
|
7
7
|
const BOTTOM_NAV = 'bottomNav';
|
|
8
8
|
const DIALOG = 'dialog';
|
|
9
9
|
const WORKFLOW_CONTAINER = 'workflowContainer';
|
|
@@ -11,6 +11,7 @@ const ACTIONS = exports.ACTIONS = 'actions';
|
|
|
11
11
|
const CELL = exports.CELL = 'cell';
|
|
12
12
|
const CREDIT_CARD = exports.CREDIT_CARD = 'creditCard';
|
|
13
13
|
const HEADER = exports.HEADER = 'header';
|
|
14
|
+
const PANEL = exports.PANEL = 'panel';
|
|
14
15
|
const SELECTION_COMPONENT = exports.SELECTION_COMPONENT = 'selectionComponent';
|
|
15
16
|
const STATUS_MESSAGE = exports.STATUS_MESSAGE = 'statusMessage';
|
|
16
17
|
const TABLE = exports.TABLE = 'table';
|
|
@@ -38,6 +39,12 @@ const COMPONENT_IDS = exports.COMPONENT_IDS = {
|
|
|
38
39
|
prevButtonId: 'onboarding.prevButton',
|
|
39
40
|
titleId: 'onboarding.title'
|
|
40
41
|
},
|
|
42
|
+
panelIds: {
|
|
43
|
+
closeButtonId: "".concat(PANEL, ".closeButton"),
|
|
44
|
+
mainActionId: "".concat(PANEL, ".mainAction"),
|
|
45
|
+
secondaryActionId: "".concat(PANEL, ".secondaryAction"),
|
|
46
|
+
titleId: "".concat(PANEL, ".title")
|
|
47
|
+
},
|
|
41
48
|
snackBarIds: {
|
|
42
49
|
closeButtonId: 'snackbar.closeButton',
|
|
43
50
|
labelId: 'snackbar.label'
|