@widergy/energy-ui 3.71.0 → 3.72.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/UTActionCard/components/AdditionalMessage/index.js +6 -1
- package/dist/components/UTActionCard/components/Header/index.js +3 -0
- package/dist/components/UTActionCard/index.js +15 -1
- package/dist/components/UTBarChart/components/Bars/components/Bar/index.js +7 -2
- package/dist/components/UTBarChart/components/Legend/constants.js +2 -17
- package/dist/components/UTBarChart/components/Legend/index.js +16 -21
- package/dist/components/UTBarChart/components/Legend/styles.module.scss +6 -16
- package/dist/components/UTBarChart/components/XAxis/components/AxisElement/index.js +30 -24
- package/dist/components/UTBarChart/components/XAxis/index.js +20 -13
- package/dist/components/UTCreditCard/index.js +4 -0
- package/dist/constants/testIds.js +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.72.0](https://github.com/widergy/energy-ui/compare/v3.71.1...v3.72.0) (2025-05-05)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [AUT-642 multi flow new ids] ([#611](https://github.com/widergy/energy-ui/issues/611)) ([6788952](https://github.com/widergy/energy-ui/commit/67889520f150a60a346f5660878dc914b7e77f7a))
|
|
7
|
+
|
|
8
|
+
## [3.71.1](https://github.com/widergy/energy-ui/compare/v3.71.0...v3.71.1) (2025-05-05)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* visual fixes on chart legends ([#612](https://github.com/widergy/energy-ui/issues/612)) ([657129a](https://github.com/widergy/energy-ui/commit/657129a7a743dcc27953de2056e1d15adde2ec51))
|
|
14
|
+
|
|
1
15
|
# [3.71.0](https://github.com/widergy/energy-ui/compare/v3.70.0...v3.71.0) (2025-05-05)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -15,6 +15,7 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
|
|
|
15
15
|
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); }
|
|
16
16
|
const AdditionalMessage = _ref => {
|
|
17
17
|
let {
|
|
18
|
+
dataTestId,
|
|
18
19
|
icon,
|
|
19
20
|
iconProps = {},
|
|
20
21
|
labelProps = {},
|
|
@@ -22,19 +23,23 @@ const AdditionalMessage = _ref => {
|
|
|
22
23
|
size
|
|
23
24
|
} = _ref;
|
|
24
25
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
25
|
-
className: "".concat(_stylesModule.default.additionalMessageContainer, " ").concat(_stylesModule.default[size])
|
|
26
|
+
className: "".concat(_stylesModule.default.additionalMessageContainer, " ").concat(_stylesModule.default[size]),
|
|
27
|
+
"data-testid": dataTestId
|
|
26
28
|
}, icon && /*#__PURE__*/_react.default.createElement(_UTIcon.default, _extends({
|
|
27
29
|
area: true,
|
|
28
30
|
colorTheme: "gray",
|
|
31
|
+
dataTestId: dataTestId ? "".concat(dataTestId, ".icon") : undefined,
|
|
29
32
|
name: icon,
|
|
30
33
|
size: 16
|
|
31
34
|
}, iconProps)), /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
|
|
32
35
|
colorTheme: "gray",
|
|
36
|
+
dataTestId: dataTestId ? "".concat(dataTestId, ".message") : undefined,
|
|
33
37
|
variant: "small",
|
|
34
38
|
withMarkdown: true
|
|
35
39
|
}, labelProps), message));
|
|
36
40
|
};
|
|
37
41
|
AdditionalMessage.propTypes = {
|
|
42
|
+
dataTestId: _propTypes.string,
|
|
38
43
|
icon: _propTypes.string,
|
|
39
44
|
iconProps: (0, _propTypes.shape)({
|
|
40
45
|
colorTheme: _propTypes.string,
|
|
@@ -28,6 +28,7 @@ const Header = _ref => {
|
|
|
28
28
|
size,
|
|
29
29
|
status,
|
|
30
30
|
statusAlignment,
|
|
31
|
+
statusDataTestId,
|
|
31
32
|
statusLabel,
|
|
32
33
|
title,
|
|
33
34
|
titleProps
|
|
@@ -45,6 +46,7 @@ const Header = _ref => {
|
|
|
45
46
|
colorTheme: "gray"
|
|
46
47
|
}, descriptionProps), description))), status ? /*#__PURE__*/_react.default.createElement(_UTStatus.default, _extends({
|
|
47
48
|
className: "".concat(_stylesModule.default["placeSelf-".concat(statusAlignment)]),
|
|
49
|
+
labelDataTestId: statusDataTestId,
|
|
48
50
|
type: "light"
|
|
49
51
|
}, (0, _utils.statusPropsMapper)(status)), statusLabel || status) : null, !(0, _array.isEmpty)(headerActions) && /*#__PURE__*/_react.default.createElement(_HeaderActions.default, {
|
|
50
52
|
headerActions,
|
|
@@ -84,6 +86,7 @@ Header.propTypes = {
|
|
|
84
86
|
size: (0, _propTypes.oneOf)([_constants.SIZES.MEDIUM, _constants.SIZES.SMALL]),
|
|
85
87
|
status: _propTypes.string,
|
|
86
88
|
statusAlignment: (0, _propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER, _constants.PLACE_SELF_TYPES.END, _constants.PLACE_SELF_TYPES.START]),
|
|
89
|
+
statusDataTestId: _propTypes.string,
|
|
87
90
|
statusLabel: _propTypes.string,
|
|
88
91
|
title: _propTypes.string,
|
|
89
92
|
titleProps: (0, _propTypes.shape)({
|
|
@@ -37,18 +37,26 @@ const UTActionCard = _ref => {
|
|
|
37
37
|
status,
|
|
38
38
|
statusAlignment,
|
|
39
39
|
statusLabel,
|
|
40
|
+
testIds = {},
|
|
40
41
|
title,
|
|
41
42
|
titleProps = {},
|
|
42
43
|
withBodyPadding = true
|
|
43
44
|
} = _ref;
|
|
44
45
|
const [mainActionHoverVisible, setMainActionHoverVisible] = (0, _react.useState)(true);
|
|
46
|
+
const {
|
|
47
|
+
backgroundDataTestId,
|
|
48
|
+
containerDataTestId,
|
|
49
|
+
statusDataTestId
|
|
50
|
+
} = testIds;
|
|
45
51
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
46
52
|
className: "".concat(_stylesModule.default.cardContainer, " ").concat(classNames.container)
|
|
47
53
|
}, /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
48
54
|
className: "".concat(_stylesModule.default.innerContainer, " ").concat(classNames.innerContainer, " ").concat(!mainAction ? _stylesModule.default.withoutMainAction : "".concat(_stylesModule.default.withMainAction, " ").concat(mainActionHoverVisible && "".concat(_stylesModule.default.mainActionHover, " ").concat(classNames.mainActionHover))),
|
|
55
|
+
dataTestId: containerDataTestId,
|
|
49
56
|
onClick: () => mainAction === null || mainAction === void 0 ? void 0 : mainAction()
|
|
50
57
|
}, BackgroundImage && /*#__PURE__*/_react.default.createElement(BackgroundImage, {
|
|
51
|
-
className: "".concat(_stylesModule.default.backgroundImage, " ").concat(classNames.backgroundImage)
|
|
58
|
+
className: "".concat(_stylesModule.default.backgroundImage, " ").concat(classNames.backgroundImage),
|
|
59
|
+
"data-testid": backgroundDataTestId
|
|
52
60
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
53
61
|
className: "".concat(_stylesModule.default.headerAndChildrenContainer, " ").concat(classNames.headerAndChildrenContainer)
|
|
54
62
|
}, /*#__PURE__*/_react.default.createElement(_Header.default, {
|
|
@@ -63,6 +71,7 @@ const UTActionCard = _ref => {
|
|
|
63
71
|
size,
|
|
64
72
|
status,
|
|
65
73
|
statusAlignment,
|
|
74
|
+
statusDataTestId,
|
|
66
75
|
statusLabel,
|
|
67
76
|
title,
|
|
68
77
|
titleProps
|
|
@@ -132,6 +141,11 @@ UTActionCard.propTypes = {
|
|
|
132
141
|
status: _propTypes.string,
|
|
133
142
|
statusLabel: _propTypes.string,
|
|
134
143
|
statusAlignment: (0, _propTypes.oneOf)([_constants.PLACE_SELF_TYPES.CENTER, _constants.PLACE_SELF_TYPES.END, _constants.PLACE_SELF_TYPES.START]),
|
|
144
|
+
testIds: (0, _propTypes.shape)({
|
|
145
|
+
backgroundDataTestId: _propTypes.string,
|
|
146
|
+
containerDataTestId: _propTypes.string,
|
|
147
|
+
statusDataTestId: _propTypes.string
|
|
148
|
+
}),
|
|
135
149
|
title: _propTypes.string,
|
|
136
150
|
titleProps: (0, _propTypes.shape)({
|
|
137
151
|
variant: _propTypes.string,
|
|
@@ -8,10 +8,14 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _UTTooltip = _interopRequireDefault(require("../../../../../UTTooltip"));
|
|
10
10
|
var _types = require("../../../../types");
|
|
11
|
+
var _testIds = require("../../../../../../constants/testIds");
|
|
11
12
|
var _Rect = _interopRequireDefault(require("./components/Rect"));
|
|
12
13
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
13
14
|
var _constants = require("./constants");
|
|
14
15
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
+
const {
|
|
17
|
+
barTooltipId
|
|
18
|
+
} = _testIds.COMPONENT_IDS.barChartIds;
|
|
15
19
|
const Bar = _ref => {
|
|
16
20
|
let {
|
|
17
21
|
width,
|
|
@@ -32,10 +36,11 @@ const Bar = _ref => {
|
|
|
32
36
|
transitionDuration
|
|
33
37
|
} = _ref;
|
|
34
38
|
return /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
39
|
+
className: tooltipClassName,
|
|
35
40
|
content: tooltipContent,
|
|
41
|
+
dataTestId: "".concat(barTooltipId).concat(id),
|
|
36
42
|
interactive: false,
|
|
37
|
-
stringContentClassName: _stylesModule.default.tooltip
|
|
38
|
-
className: tooltipClassName
|
|
43
|
+
stringContentClassName: _stylesModule.default.tooltip
|
|
39
44
|
}, /*#__PURE__*/_react.default.createElement("g", {
|
|
40
45
|
className: "".concat(clickable && _stylesModule.default.clickable, " ").concat(_stylesModule.default.rect),
|
|
41
46
|
onClick: clickable ? () => onClick(index, data) : _constants.NO_OP
|
|
@@ -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
|
|
|
@@ -11,28 +11,31 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
11
11
|
const AxisElement = _ref => {
|
|
12
12
|
var _textRef$getBoundingC, _textRef$getBoundingC2, _textRef$getBoundingC3, _textRef$getBoundingC4, _textRef$getBoundingC5;
|
|
13
13
|
let {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
barRef,
|
|
15
|
+
circle,
|
|
16
16
|
className,
|
|
17
|
+
color,
|
|
18
|
+
graphYStart,
|
|
19
|
+
labelBackgroundPadding,
|
|
20
|
+
labelYOffset,
|
|
17
21
|
mainLabel,
|
|
22
|
+
mainLabelDataTestId,
|
|
18
23
|
mainLabelStyles,
|
|
19
24
|
secondaryLabel,
|
|
20
|
-
|
|
21
|
-
yOffset,
|
|
22
|
-
labelYOffset,
|
|
23
|
-
circle,
|
|
24
|
-
square,
|
|
25
|
+
secondaryLabelDataTestId,
|
|
25
26
|
selected,
|
|
26
27
|
selectedLabelBackground,
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
square,
|
|
29
|
+
x,
|
|
30
|
+
yOffset
|
|
29
31
|
} = _ref;
|
|
30
32
|
const y = graphYStart + yOffset;
|
|
31
33
|
const [textRef, setTextRef] = (0, _react.useState)();
|
|
32
34
|
return /*#__PURE__*/_react.default.createElement("g", null, secondaryLabel && /*#__PURE__*/_react.default.createElement("text", {
|
|
33
35
|
className: className,
|
|
34
|
-
|
|
36
|
+
"data-testid": secondaryLabelDataTestId,
|
|
35
37
|
fill: color,
|
|
38
|
+
textAnchor: "middle",
|
|
36
39
|
x: x,
|
|
37
40
|
y: y
|
|
38
41
|
}, secondaryLabel), mainLabel && /*#__PURE__*/_react.default.createElement("g", null, circle && /*#__PURE__*/_react.default.createElement("circle", _extends({
|
|
@@ -60,32 +63,35 @@ const AxisElement = _ref => {
|
|
|
60
63
|
fill: selectedLabelBackground,
|
|
61
64
|
rx: "14"
|
|
62
65
|
}), /*#__PURE__*/_react.default.createElement("text", _extends({
|
|
63
|
-
ref: el => setTextRef(el),
|
|
64
66
|
className: className,
|
|
65
|
-
|
|
67
|
+
"data-testid": mainLabelDataTestId,
|
|
66
68
|
fill: color,
|
|
69
|
+
ref: el => setTextRef(el),
|
|
70
|
+
textAnchor: "middle",
|
|
67
71
|
x: x,
|
|
68
72
|
y: y + yOffset + labelYOffset
|
|
69
73
|
}, mainLabelStyles), mainLabel)));
|
|
70
74
|
};
|
|
71
75
|
AxisElement.propTypes = {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
x: _propTypes.number,
|
|
76
|
-
graphYStart: _propTypes.number,
|
|
77
|
-
yOffset: _propTypes.number,
|
|
78
|
-
labelYOffset: _propTypes.number,
|
|
76
|
+
barRef: _propTypes.object,
|
|
77
|
+
borderSelector: _propTypes.object,
|
|
78
|
+
circle: _propTypes.object,
|
|
79
79
|
className: _propTypes.string,
|
|
80
80
|
color: _propTypes.string,
|
|
81
81
|
graphYEnd: _propTypes.number,
|
|
82
|
+
graphYStart: _propTypes.number,
|
|
82
83
|
isActive: _propTypes.bool,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
labelBackgroundPadding: _propTypes.number,
|
|
85
|
+
labelYOffset: _propTypes.number,
|
|
86
|
+
mainLabel: _propTypes.string,
|
|
87
|
+
mainLabelDataTestId: _propTypes.string,
|
|
88
|
+
mainLabelStyles: _propTypes.object,
|
|
89
|
+
secondaryLabel: _propTypes.string,
|
|
90
|
+
secondaryLabelDataTestId: _propTypes.string,
|
|
86
91
|
selected: _propTypes.bool,
|
|
87
92
|
selectedLabelBackground: _propTypes.string,
|
|
88
|
-
|
|
89
|
-
|
|
93
|
+
square: _propTypes.object,
|
|
94
|
+
x: _propTypes.number,
|
|
95
|
+
yOffset: _propTypes.number
|
|
90
96
|
};
|
|
91
97
|
var _default = exports.default = AxisElement;
|
|
@@ -7,13 +7,18 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _utils = require("../../utils");
|
|
10
|
-
var _commonTypes = require("../../../../types/commonTypes");
|
|
11
10
|
var _types = require("../../types");
|
|
11
|
+
var _commonTypes = require("../../../../types/commonTypes");
|
|
12
|
+
var _testIds = require("../../../../constants/testIds");
|
|
12
13
|
var _AxisElement = _interopRequireDefault(require("./components/AxisElement"));
|
|
13
14
|
var _Decoration = _interopRequireDefault(require("./components/Decoration"));
|
|
14
15
|
var _constants = require("./constants");
|
|
15
16
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
17
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
18
|
+
const {
|
|
19
|
+
xAxisSecondaryLabelId,
|
|
20
|
+
xAxisMainLabelId
|
|
21
|
+
} = _testIds.COMPONENT_IDS.barChartIds;
|
|
17
22
|
const XAxis = _ref => {
|
|
18
23
|
let {
|
|
19
24
|
data,
|
|
@@ -73,21 +78,22 @@ const XAxis = _ref => {
|
|
|
73
78
|
} = _ref2;
|
|
74
79
|
const selected = index === currentLabel;
|
|
75
80
|
return /*#__PURE__*/_react.default.createElement(_AxisElement.default, {
|
|
76
|
-
|
|
81
|
+
barRef: barRef,
|
|
77
82
|
barWidth: barWidth,
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
circle: circle,
|
|
84
|
+
className: "".concat(classes.xAxisMainLabel, " ").concat(selected && classes.xAxisSelectedLabel),
|
|
80
85
|
color: color || '',
|
|
81
|
-
x: fullSizeBars ? graphXEnd / 2 + customXOffset : xAxis(index) + xOffset,
|
|
82
86
|
graphYStart: graphYStart,
|
|
83
|
-
|
|
87
|
+
labelBackgroundPadding: labelBackgroundPadding,
|
|
84
88
|
labelYOffset: labelYOffset,
|
|
85
|
-
|
|
86
|
-
|
|
89
|
+
mainLabel: mainLabel,
|
|
90
|
+
mainLabelDataTestId: "".concat(xAxisMainLabelId).concat(index),
|
|
91
|
+
mainLabelStyles: mainLabelStyles,
|
|
87
92
|
selected: selected,
|
|
88
93
|
selectedLabelBackground: selectedLabelBackground,
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
square: square,
|
|
95
|
+
x: fullSizeBars ? graphXEnd / 2 + customXOffset : xAxis(index) + xOffset,
|
|
96
|
+
yOffset: _constants.Y_OFFSET
|
|
91
97
|
});
|
|
92
98
|
})), /*#__PURE__*/_react.default.createElement("g", null, xAxisDefinition.map((_ref3, index) => {
|
|
93
99
|
let {
|
|
@@ -95,12 +101,13 @@ const XAxis = _ref => {
|
|
|
95
101
|
color
|
|
96
102
|
} = _ref3;
|
|
97
103
|
return /*#__PURE__*/_react.default.createElement(_AxisElement.default, {
|
|
98
|
-
className: classes.xAxisSecondaryLabel,
|
|
99
104
|
barWidth: barWidth,
|
|
100
|
-
|
|
105
|
+
className: classes.xAxisSecondaryLabel,
|
|
101
106
|
color: color || '',
|
|
102
|
-
x: xAxis(index) + xOffset,
|
|
103
107
|
graphYStart: graphYStart,
|
|
108
|
+
secondaryLabel: secondaryLabel,
|
|
109
|
+
secondaryLabelDataTestId: "".concat(xAxisSecondaryLabelId).concat(index),
|
|
110
|
+
x: xAxis(index) + xOffset,
|
|
104
111
|
yOffset: _constants.Y_OFFSET
|
|
105
112
|
});
|
|
106
113
|
})))), /*#__PURE__*/_react.default.createElement("g", null, formattedDecorators.map(decoration => /*#__PURE__*/_react.default.createElement(_Decoration.default, {
|
|
@@ -95,6 +95,7 @@ const UTCreditCard = _ref => {
|
|
|
95
95
|
onFocus: () => setFocused(_constants.fields.NUMBER),
|
|
96
96
|
required: true,
|
|
97
97
|
title: numberTitle,
|
|
98
|
+
validationDataTestId: "".concat(cardFieldId, ".validation"),
|
|
98
99
|
value: values[cardField],
|
|
99
100
|
version: "V1"
|
|
100
101
|
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -109,6 +110,7 @@ const UTCreditCard = _ref => {
|
|
|
109
110
|
onFocus: () => setFocused(_constants.fields.EXPIRY),
|
|
110
111
|
required: true,
|
|
111
112
|
title: expiryTitle,
|
|
113
|
+
validationDataTestId: "".concat(expiresId, ".validation"),
|
|
112
114
|
value: values[expires],
|
|
113
115
|
version: "V1"
|
|
114
116
|
}), /*#__PURE__*/_react.default.createElement(_UTPasswordField.default, {
|
|
@@ -122,6 +124,7 @@ const UTCreditCard = _ref => {
|
|
|
122
124
|
title: cvcTitle,
|
|
123
125
|
required: true,
|
|
124
126
|
onFocus: () => setFocused(_constants.fields.CVC),
|
|
127
|
+
validationDataTestId: "".concat(cvcFieldId, ".validation"),
|
|
125
128
|
value: values[cvcField],
|
|
126
129
|
version: "V1"
|
|
127
130
|
})), /*#__PURE__*/_react.default.createElement(_UTTextInput.default, {
|
|
@@ -131,6 +134,7 @@ const UTCreditCard = _ref => {
|
|
|
131
134
|
required: true,
|
|
132
135
|
onFocus: () => setFocused(_constants.fields.NAME),
|
|
133
136
|
title: nameTitle,
|
|
137
|
+
validationDataTestId: "".concat(nameFieldId, ".validation"),
|
|
134
138
|
value: values[nameFiled],
|
|
135
139
|
version: "V1"
|
|
136
140
|
})));
|
|
@@ -17,6 +17,11 @@ const STATUS_MESSAGE = exports.STATUS_MESSAGE = 'statusMessage';
|
|
|
17
17
|
const TABLE = exports.TABLE = 'table';
|
|
18
18
|
const TABLE_ROW = exports.TABLE_ROW = 'tableRow';
|
|
19
19
|
const COMPONENT_IDS = exports.COMPONENT_IDS = {
|
|
20
|
+
barChartIds: {
|
|
21
|
+
xAxisSecondaryLabelId: 'barChart.xAxis.secondaryLabel.',
|
|
22
|
+
xAxisMainLabelId: 'barChart.xAxis.mainLabel.',
|
|
23
|
+
barTooltipId: 'barChart.bar.tooltip.'
|
|
24
|
+
},
|
|
20
25
|
breadcrumbsIds: {
|
|
21
26
|
buttonId: 'breadcrumbs.item'
|
|
22
27
|
},
|