@widergy/energy-ui 3.25.0 → 3.26.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 +7 -0
- package/dist/components/UTActionCard/components/BottomActions/index.js +3 -0
- package/dist/components/UTAutocomplete/index.js +5 -0
- package/dist/components/UTButtonGroup/index.js +2 -0
- package/dist/components/UTCBUInput/index.js +21 -18
- package/dist/components/UTCard/index.js +6 -2
- package/dist/components/UTCheckbox/index.js +8 -0
- package/dist/components/UTCuit/index.js +51 -27
- package/dist/components/UTGoogleAutocomplete/index.js +2 -0
- package/dist/components/UTLabel/index.js +4 -1
- package/dist/components/UTOnboarding/index.js +15 -0
- package/dist/components/UTPasswordField/versions/V0/index.js +3 -0
- package/dist/components/UTPhoneInput/versions/V0/index.js +11 -1
- package/dist/components/UTStatus/index.js +3 -0
- package/dist/components/UTTable/index.js +4 -1
- package/dist/components/UTTextArea/versions/V0/index.js +3 -0
- package/dist/components/UTTextInput/versions/V0/index.js +5 -0
- package/dist/types/googleMapsTypes.js +1 -0
- package/package.json +3 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [3.26.0](https://github.com/widergy/energy-ui/compare/v3.25.0...v3.26.0) (2024-10-08)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* button, label and input test-id ([#498](https://github.com/widergy/energy-ui/issues/498)) ([9ba23dc](https://github.com/widergy/energy-ui/commit/9ba23dc19ec632ee02dca97f1fa6c5a8f7bdd582))
|
|
7
|
+
|
|
1
8
|
# [3.25.0](https://github.com/widergy/energy-ui/compare/v3.24.0...v3.25.0) (2024-10-07)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -24,6 +24,7 @@ const BottomActions = _ref => {
|
|
|
24
24
|
}, actions.map(_ref2 => {
|
|
25
25
|
let {
|
|
26
26
|
colorTheme = 'primary',
|
|
27
|
+
dataTestId,
|
|
27
28
|
disabled,
|
|
28
29
|
Icon,
|
|
29
30
|
label,
|
|
@@ -37,6 +38,7 @@ const BottomActions = _ref => {
|
|
|
37
38
|
text: "".concat(type === _constants.ACTION_TYPES.REDIRECTION ? _stylesModule.default.redirectionText : _stylesModule.default.defaultText)
|
|
38
39
|
},
|
|
39
40
|
colorTheme: colorTheme,
|
|
41
|
+
dataTestId: dataTestId,
|
|
40
42
|
disabled: disabled,
|
|
41
43
|
Icon: type === _constants.ACTION_TYPES.REDIRECTION ? 'IconChevronRight' : Icon,
|
|
42
44
|
iconPlacement: type === _constants.ACTION_TYPES.REDIRECTION ? 'right' : 'left',
|
|
@@ -51,6 +53,7 @@ const BottomActions = _ref => {
|
|
|
51
53
|
BottomActions.propTypes = {
|
|
52
54
|
actions: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
53
55
|
colorTheme: _propTypes.string,
|
|
56
|
+
dataTestId: _propTypes.string,
|
|
54
57
|
disabled: _propTypes.bool,
|
|
55
58
|
Icon: (0, _propTypes.oneOfType)([_propTypes.elementType, _propTypes.string]),
|
|
56
59
|
label: _propTypes.string,
|
|
@@ -27,6 +27,7 @@ const UTAutocomplete = _ref => {
|
|
|
27
27
|
ArrowIcon,
|
|
28
28
|
autocompleteProps,
|
|
29
29
|
classes = {},
|
|
30
|
+
dataTestId,
|
|
30
31
|
disabled,
|
|
31
32
|
field,
|
|
32
33
|
fixedSizeListProps,
|
|
@@ -103,6 +104,9 @@ const UTAutocomplete = _ref => {
|
|
|
103
104
|
colorTheme: "error",
|
|
104
105
|
variant: "small"
|
|
105
106
|
}, errorMessage) : undefined,
|
|
107
|
+
inputProps: {
|
|
108
|
+
'data-testid': dataTestId
|
|
109
|
+
},
|
|
106
110
|
placeholder: placeholder,
|
|
107
111
|
variant: variant
|
|
108
112
|
}, textFieldProps))
|
|
@@ -112,6 +116,7 @@ UTAutocomplete.propTypes = {
|
|
|
112
116
|
ArrowIcon: _propTypes.elementType,
|
|
113
117
|
autocompleteProps: _propTypes.object,
|
|
114
118
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
119
|
+
dataTestId: _propTypes.string,
|
|
115
120
|
disabled: _propTypes.bool,
|
|
116
121
|
input: _formTypes.inputPropTypes.isRequired,
|
|
117
122
|
field: _formTypes.fieldType,
|
|
@@ -25,12 +25,14 @@ const UTButtonGroup = _ref => {
|
|
|
25
25
|
className: "".concat(_stylesModule.default["".concat(type, "Container")], " ").concat(backgroundColor)
|
|
26
26
|
}, actions.map(_ref2 => {
|
|
27
27
|
let {
|
|
28
|
+
dataTestId,
|
|
28
29
|
Icon,
|
|
29
30
|
id,
|
|
30
31
|
onClick
|
|
31
32
|
} = _ref2;
|
|
32
33
|
return /*#__PURE__*/_react.default.createElement(_UTButton.default, {
|
|
33
34
|
colorTheme: colorTheme,
|
|
35
|
+
dataTestId: dataTestId,
|
|
34
36
|
Icon: Icon,
|
|
35
37
|
key: id,
|
|
36
38
|
onClick: onClick,
|
|
@@ -15,10 +15,11 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
15
15
|
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; }
|
|
16
16
|
const UTCBUInput = _ref => {
|
|
17
17
|
let {
|
|
18
|
-
|
|
18
|
+
classes,
|
|
19
|
+
dataTestId,
|
|
19
20
|
field,
|
|
20
21
|
input,
|
|
21
|
-
|
|
22
|
+
meta
|
|
22
23
|
} = _ref;
|
|
23
24
|
const {
|
|
24
25
|
onChange,
|
|
@@ -45,6 +46,14 @@ const UTCBUInput = _ref => {
|
|
|
45
46
|
});
|
|
46
47
|
};
|
|
47
48
|
return /*#__PURE__*/_react.default.createElement(_UTTextInput.default, {
|
|
49
|
+
captionLabel: entity,
|
|
50
|
+
dataTestId: dataTestId,
|
|
51
|
+
field: field,
|
|
52
|
+
FormHelperTextProps: {
|
|
53
|
+
classes: {
|
|
54
|
+
root: classes.helper
|
|
55
|
+
}
|
|
56
|
+
},
|
|
48
57
|
input: {
|
|
49
58
|
onChange: onChangeText,
|
|
50
59
|
value: {
|
|
@@ -52,28 +61,15 @@ const UTCBUInput = _ref => {
|
|
|
52
61
|
[cbuEntityKey]: entity
|
|
53
62
|
}
|
|
54
63
|
},
|
|
55
|
-
|
|
56
|
-
placeholder: placeholder,
|
|
64
|
+
inputObjectKey: cbuNumberKey,
|
|
57
65
|
label: title,
|
|
58
66
|
meta: meta,
|
|
59
|
-
|
|
60
|
-
FormHelperTextProps: {
|
|
61
|
-
classes: {
|
|
62
|
-
root: classes.helper
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
inputObjectKey: cbuNumberKey
|
|
67
|
+
placeholder: placeholder
|
|
66
68
|
});
|
|
67
69
|
};
|
|
68
70
|
UTCBUInput.propTypes = {
|
|
69
71
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
70
|
-
|
|
71
|
-
onChange: _propTypes.func,
|
|
72
|
-
value: (0, _propTypes.shape)({
|
|
73
|
-
cbuNumber: _propTypes.string,
|
|
74
|
-
entityName: _propTypes.string
|
|
75
|
-
})
|
|
76
|
-
}),
|
|
72
|
+
dataTestId: _propTypes.string,
|
|
77
73
|
field: (0, _propTypes.shape)({
|
|
78
74
|
placeholder: _propTypes.string,
|
|
79
75
|
title: _propTypes.string,
|
|
@@ -83,6 +79,13 @@ UTCBUInput.propTypes = {
|
|
|
83
79
|
cbu_number_key: _propTypes.string,
|
|
84
80
|
cbu_entity_key: _propTypes.string
|
|
85
81
|
}),
|
|
82
|
+
input: (0, _propTypes.shape)({
|
|
83
|
+
onChange: _propTypes.func,
|
|
84
|
+
value: (0, _propTypes.shape)({
|
|
85
|
+
cbuNumber: _propTypes.string,
|
|
86
|
+
entityName: _propTypes.string
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
86
89
|
meta: _formTypes.metaPropTypes
|
|
87
90
|
};
|
|
88
91
|
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTCBUInput);
|
|
@@ -56,9 +56,10 @@ class UTCard extends _react.PureComponent {
|
|
|
56
56
|
classes: themeClasses,
|
|
57
57
|
classNames,
|
|
58
58
|
CustomFooter,
|
|
59
|
-
|
|
59
|
+
dataTestId,
|
|
60
60
|
ExpandedIcon,
|
|
61
61
|
expandText,
|
|
62
|
+
expandableIconProps,
|
|
62
63
|
flat,
|
|
63
64
|
footer,
|
|
64
65
|
header,
|
|
@@ -82,11 +83,13 @@ class UTCard extends _react.PureComponent {
|
|
|
82
83
|
});
|
|
83
84
|
return !isCollapsible ? /*#__PURE__*/_react.default.createElement("div", {
|
|
84
85
|
className: "".concat(classes.base, " ").concat(flat && classes.flat, " ").concat(!horizontal && _stylesModule.default.column, " ").concat(classes.base),
|
|
86
|
+
"data-testid": dataTestId,
|
|
85
87
|
style: style
|
|
86
88
|
}, header && /*#__PURE__*/_react.default.createElement("div", {
|
|
87
89
|
className: _stylesModule.default.headerContent
|
|
88
90
|
}, header), children, CustomFooter ? /*#__PURE__*/_react.default.createElement(CustomFooter, null) : Footer) : /*#__PURE__*/_react.default.createElement("div", {
|
|
89
91
|
className: "".concat(classes.base, " ").concat(flat && classes.flat, " ").concat(_stylesModule.default.column),
|
|
92
|
+
"data-testid": dataTestId,
|
|
90
93
|
style: style
|
|
91
94
|
}, /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
92
95
|
onClick: this.handleOnPress,
|
|
@@ -118,9 +121,10 @@ UTCard.propTypes = {
|
|
|
118
121
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
119
122
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
120
123
|
CustomFooter: (0, _propTypes.oneOfType)([_propTypes.element, _propTypes.func]),
|
|
121
|
-
|
|
124
|
+
dataTestId: _propTypes.string,
|
|
122
125
|
ExpandedIcon: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.element]),
|
|
123
126
|
expandText: _propTypes.string,
|
|
127
|
+
expandableIconProps: _propTypes.object,
|
|
124
128
|
flat: _propTypes.bool,
|
|
125
129
|
footer: _types.cardActionsTypes.footer,
|
|
126
130
|
header: _types.cardActionsTypes.header,
|
|
@@ -36,6 +36,7 @@ const UTCheckbox = _ref => {
|
|
|
36
36
|
classes: themeClasses = {},
|
|
37
37
|
classNames,
|
|
38
38
|
color = 'primary',
|
|
39
|
+
checkboxDataTestId,
|
|
39
40
|
CustomCheckedIcon = Checked,
|
|
40
41
|
customRowLabel: CustomRowLabel,
|
|
41
42
|
CustomUncheckedIcon = _ref2 => {
|
|
@@ -51,6 +52,7 @@ const UTCheckbox = _ref => {
|
|
|
51
52
|
input,
|
|
52
53
|
item,
|
|
53
54
|
label,
|
|
55
|
+
labelDataTestId,
|
|
54
56
|
labelProps = {},
|
|
55
57
|
meta,
|
|
56
58
|
onChange,
|
|
@@ -82,6 +84,9 @@ const UTCheckbox = _ref => {
|
|
|
82
84
|
checkedIcon: useCustomIcons && /*#__PURE__*/_react.default.createElement(CustomCheckedIcon, {
|
|
83
85
|
className: classes.checkedIcon
|
|
84
86
|
}),
|
|
87
|
+
inputProps: {
|
|
88
|
+
'data-testid': checkboxDataTestId
|
|
89
|
+
},
|
|
85
90
|
icon: useCustomIcons && /*#__PURE__*/_react.default.createElement(CustomUncheckedIcon, {
|
|
86
91
|
className: classes.uncheckedIcon
|
|
87
92
|
}),
|
|
@@ -96,6 +101,7 @@ const UTCheckbox = _ref => {
|
|
|
96
101
|
item: item
|
|
97
102
|
}) : /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
|
|
98
103
|
className: classes.label,
|
|
104
|
+
dataTestId: labelDataTestId,
|
|
99
105
|
variant: "small",
|
|
100
106
|
withMarkdown: true
|
|
101
107
|
}, labelProps), label),
|
|
@@ -115,6 +121,7 @@ UTCheckbox.propTypes = {
|
|
|
115
121
|
}),
|
|
116
122
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
117
123
|
color: _propTypes.string,
|
|
124
|
+
checkboxDataTestId: _propTypes.string,
|
|
118
125
|
CustomCheckedIcon: _propTypes.node,
|
|
119
126
|
customRowLabel: (0, _propTypes.oneOfType)([_propTypes.func, _propTypes.element, _propTypes.string]),
|
|
120
127
|
CustomUncheckedIcon: _propTypes.node,
|
|
@@ -123,6 +130,7 @@ UTCheckbox.propTypes = {
|
|
|
123
130
|
input: _formTypes.inputPropTypes,
|
|
124
131
|
item: (0, _propTypes.oneOfType)([_propTypes.string, _propTypes.object]),
|
|
125
132
|
label: (0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string]),
|
|
133
|
+
labelDataTestId: _propTypes.string,
|
|
126
134
|
labelProps: _propTypes.object,
|
|
127
135
|
meta: _formTypes.metaPropTypes,
|
|
128
136
|
onChange: _propTypes.func,
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _TextField = _interopRequireDefault(require("@material-ui/core/TextField"));
|
|
9
9
|
var _form = require("@widergy/web-utils/lib/form");
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
10
11
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
11
12
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
12
13
|
var _formTypes = require("../../types/formTypes");
|
|
@@ -93,55 +94,75 @@ class UTCuit extends _react.PureComponent {
|
|
|
93
94
|
document,
|
|
94
95
|
verificationCode
|
|
95
96
|
} = this.state;
|
|
97
|
+
const {
|
|
98
|
+
documentDataTestId,
|
|
99
|
+
prefixDataTestId,
|
|
100
|
+
verificationCodeDataTestId
|
|
101
|
+
} = this.props;
|
|
96
102
|
this.handleFocus();
|
|
97
103
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
98
104
|
className: _stylesModule.default.container
|
|
99
105
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
100
106
|
className: _stylesModule.default.fieldContainer
|
|
101
107
|
}, /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
102
|
-
className: _stylesModule.default.fieldCuit,
|
|
103
|
-
name: "prefix",
|
|
104
|
-
label: this.props.field.label,
|
|
105
108
|
autoComplete: "off",
|
|
106
|
-
|
|
109
|
+
autoFocus: this.props.field.configuration.auto_focus,
|
|
110
|
+
className: _stylesModule.default.fieldCuit,
|
|
111
|
+
error: (0, _form.shouldShowErrors)(this.props.meta) ? this.props.meta.error : '',
|
|
112
|
+
fullWidth: true,
|
|
107
113
|
InputLabelProps: {
|
|
108
114
|
shrink: this.props.input.value !== 0
|
|
109
115
|
},
|
|
116
|
+
InputProps: {
|
|
117
|
+
type: 'input',
|
|
118
|
+
inputProps: {
|
|
119
|
+
'data-testid': prefixDataTestId
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
label: this.props.field.label,
|
|
123
|
+
margin: "none",
|
|
124
|
+
name: "prefix",
|
|
110
125
|
onChange: this.handleOnChangePrefix,
|
|
111
126
|
onKeyPress: this.handleKeyPress,
|
|
112
|
-
|
|
113
|
-
value: prefix
|
|
114
|
-
InputProps: "input",
|
|
115
|
-
fullWidth: true,
|
|
116
|
-
margin: "none",
|
|
117
|
-
autoFocus: this.props.field.configuration.auto_focus
|
|
127
|
+
placeholder: "XX",
|
|
128
|
+
value: prefix
|
|
118
129
|
}), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
119
|
-
name: "document",
|
|
120
|
-
className: _stylesModule.default.fieldDocument,
|
|
121
130
|
autoComplete: "off",
|
|
122
|
-
|
|
123
|
-
onKeyPress: this.handleKeyPress,
|
|
131
|
+
className: _stylesModule.default.fieldDocument,
|
|
124
132
|
disabled: this.props.field.configuration.disable_document,
|
|
125
133
|
error: (0, _form.shouldShowErrors)(this.props.meta) ? this.props.meta.error : '',
|
|
126
|
-
value: document,
|
|
127
|
-
onChange: this.handleOnChangeDocument,
|
|
128
134
|
fullWidth: true,
|
|
129
|
-
InputProps:
|
|
135
|
+
InputProps: {
|
|
136
|
+
type: 'text',
|
|
137
|
+
inputProps: {
|
|
138
|
+
'data-testid': documentDataTestId
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
inputRef: this.documentRef,
|
|
130
142
|
margin: "none",
|
|
131
|
-
|
|
143
|
+
name: "document",
|
|
144
|
+
onChange: this.handleOnChangeDocument,
|
|
145
|
+
onKeyPress: this.handleKeyPress,
|
|
146
|
+
placeholder: "XXXXXXXX",
|
|
147
|
+
value: document
|
|
132
148
|
}), /*#__PURE__*/_react.default.createElement(_TextField.default, {
|
|
133
149
|
autoComplete: "off",
|
|
134
150
|
className: _stylesModule.default.fieldCuit,
|
|
135
|
-
name: "verificationCode",
|
|
136
|
-
placeholder: "X",
|
|
137
|
-
fullWidth: true,
|
|
138
|
-
onKeyPress: this.handleKeyPress,
|
|
139
151
|
error: (0, _form.shouldShowErrors)(this.props.meta) ? this.props.meta.error : '',
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
InputProps:
|
|
152
|
+
fullWidth: true,
|
|
153
|
+
inputRef: this.verificationCodeRef,
|
|
154
|
+
InputProps: {
|
|
155
|
+
type: 'input',
|
|
156
|
+
inputProps: {
|
|
157
|
+
'data-testid': verificationCodeDataTestId
|
|
158
|
+
}
|
|
159
|
+
},
|
|
143
160
|
margin: "none",
|
|
144
|
-
|
|
161
|
+
name: "verificationCode",
|
|
162
|
+
onChange: this.handleOnChangeVerificationCode,
|
|
163
|
+
onKeyPress: this.handleKeyPress,
|
|
164
|
+
placeholder: "X",
|
|
165
|
+
value: verificationCode
|
|
145
166
|
})), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
146
167
|
variant: "small",
|
|
147
168
|
colorTheme: "error"
|
|
@@ -149,8 +170,11 @@ class UTCuit extends _react.PureComponent {
|
|
|
149
170
|
}
|
|
150
171
|
}
|
|
151
172
|
UTCuit.propTypes = {
|
|
173
|
+
documentDataTestId: _propTypes.string,
|
|
174
|
+
field: _formTypes.fieldType,
|
|
152
175
|
input: _formTypes.inputPropTypes,
|
|
153
176
|
meta: _formTypes.metaPropTypes,
|
|
154
|
-
|
|
177
|
+
prefixDataTestId: _propTypes.string,
|
|
178
|
+
verificationCodeDataTestId: _propTypes.string
|
|
155
179
|
};
|
|
156
180
|
var _default = exports.default = (0, _WithTheme.default)(null, _theme.retrieveMuiTheme)(UTCuit);
|
|
@@ -25,6 +25,7 @@ const UTGoogleAutocomplete = _ref => {
|
|
|
25
25
|
let {
|
|
26
26
|
alert,
|
|
27
27
|
classes,
|
|
28
|
+
dataTestId,
|
|
28
29
|
detailErrorLabel = 'Hubo un error al intentar recuperar el detalle de la dirección seleccionada',
|
|
29
30
|
inputProps,
|
|
30
31
|
minChar = 3,
|
|
@@ -90,6 +91,7 @@ const UTGoogleAutocomplete = _ref => {
|
|
|
90
91
|
}, /*#__PURE__*/_react.default.createElement(_UTAlert.default, {
|
|
91
92
|
content: alert
|
|
92
93
|
}), /*#__PURE__*/_react.default.createElement(_UTTextInput.default, _extends({
|
|
94
|
+
dataTestId: dataTestId,
|
|
93
95
|
input: {
|
|
94
96
|
value: searchInputValue,
|
|
95
97
|
onChange: handleInputChange
|
|
@@ -22,8 +22,9 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
22
22
|
const UTLabel = _ref => {
|
|
23
23
|
let {
|
|
24
24
|
children,
|
|
25
|
-
classes: theme,
|
|
26
25
|
className,
|
|
26
|
+
classes: theme,
|
|
27
|
+
dataTestId,
|
|
27
28
|
markdownRenderers,
|
|
28
29
|
title,
|
|
29
30
|
variant,
|
|
@@ -36,6 +37,7 @@ const UTLabel = _ref => {
|
|
|
36
37
|
}), [theme, className]);
|
|
37
38
|
return /*#__PURE__*/_react.default.createElement(_UTSkeleton.default, null, /*#__PURE__*/_react.default.createElement(Component, {
|
|
38
39
|
className: "".concat(classes.root, " ").concat(classes.className).trim(),
|
|
40
|
+
"data-testid": dataTestId,
|
|
39
41
|
title: title
|
|
40
42
|
}, withMarkdown && /*#__PURE__*/_react.default.createElement(_reactMarkdown.default, {
|
|
41
43
|
children: children,
|
|
@@ -51,6 +53,7 @@ UTLabel.defaultProps = _constants.DEFAULT_PROPS;
|
|
|
51
53
|
UTLabel.propTypes = {
|
|
52
54
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
53
55
|
className: _propTypes.string,
|
|
56
|
+
dataTestId: _propTypes.string,
|
|
54
57
|
markdownRenderers: (0, _propTypes.objectOf)(_propTypes.func),
|
|
55
58
|
title: _propTypes.string,
|
|
56
59
|
variant: _propTypes.string,
|
|
@@ -21,12 +21,14 @@ const UTOnboarding = _ref => {
|
|
|
21
21
|
var _steps$currentStep$is, _steps$currentStep, _steps$currentStep$hi, _steps$currentStep2, _steps$currentStep3, _steps$currentStep4;
|
|
22
22
|
let {
|
|
23
23
|
classes: themeClasses,
|
|
24
|
+
closeButtonDataTestId,
|
|
24
25
|
classNames,
|
|
25
26
|
enabled,
|
|
26
27
|
handleComplete,
|
|
27
28
|
handleOnClose,
|
|
28
29
|
options,
|
|
29
30
|
steps,
|
|
31
|
+
titleDataTestId,
|
|
30
32
|
variant
|
|
31
33
|
} = _ref;
|
|
32
34
|
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [themeClasses, classNames]) || {};
|
|
@@ -35,6 +37,17 @@ const UTOnboarding = _ref => {
|
|
|
35
37
|
const currentStepIsSuggestion = (_steps$currentStep$is = (_steps$currentStep = steps[currentStep]) === null || _steps$currentStep === void 0 ? void 0 : _steps$currentStep.isSuggestion) !== null && _steps$currentStep$is !== void 0 ? _steps$currentStep$is : false;
|
|
36
38
|
const hideFooter = (_steps$currentStep$hi = (_steps$currentStep2 = steps[currentStep]) === null || _steps$currentStep2 === void 0 ? void 0 : _steps$currentStep2.hideFooter) !== null && _steps$currentStep$hi !== void 0 ? _steps$currentStep$hi : false;
|
|
37
39
|
const totalSteps = steps.length;
|
|
40
|
+
|
|
41
|
+
// This timeout is here only to get the querySelectors out of the call-stack order, giving the Step component time to render every child inside. This
|
|
42
|
+
// is necessary to find the html element searched by the selectors.
|
|
43
|
+
setTimeout(() => {
|
|
44
|
+
var _skipButton$attribute, _stepTitle$attributes, _skipButton$setAttrib, _stepTitle$setAttribu;
|
|
45
|
+
const skipButton = document.querySelector('.introjs-skipbutton');
|
|
46
|
+
const stepTitle = document.querySelector('.introjs-tooltip-title');
|
|
47
|
+
if (skipButton !== null && skipButton !== void 0 && (_skipButton$attribute = skipButton.attributes) !== null && _skipButton$attribute !== void 0 && _skipButton$attribute['data-testid'] && stepTitle !== null && stepTitle !== void 0 && (_stepTitle$attributes = stepTitle.attributes) !== null && _stepTitle$attributes !== void 0 && _stepTitle$attributes['data-testid']) return;
|
|
48
|
+
skipButton === null || skipButton === void 0 || (_skipButton$setAttrib = skipButton.setAttribute) === null || _skipButton$setAttrib === void 0 || _skipButton$setAttrib.call(skipButton, 'data-testid', closeButtonDataTestId);
|
|
49
|
+
stepTitle === null || stepTitle === void 0 || (_stepTitle$setAttribu = stepTitle.setAttribute) === null || _stepTitle$setAttribu === void 0 || _stepTitle$setAttribu.call(stepTitle, 'data-testid', titleDataTestId);
|
|
50
|
+
}, 1);
|
|
38
51
|
(0, _react.useEffect)(() => {
|
|
39
52
|
setLoading(false);
|
|
40
53
|
}, [steps]);
|
|
@@ -113,11 +126,13 @@ const UTOnboarding = _ref => {
|
|
|
113
126
|
UTOnboarding.propTypes = {
|
|
114
127
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
115
128
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
129
|
+
closeButtonDataTestId: _propTypes.string,
|
|
116
130
|
enabled: _propTypes.bool,
|
|
117
131
|
handleComplete: _propTypes.func,
|
|
118
132
|
handleOnClose: _propTypes.func,
|
|
119
133
|
options: _propTypes.object,
|
|
120
134
|
steps: _propTypes.array,
|
|
135
|
+
titleDataTestId: _propTypes.string,
|
|
121
136
|
variant: _propTypes.string
|
|
122
137
|
};
|
|
123
138
|
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTOnboarding);
|
|
@@ -19,6 +19,7 @@ const UTPasswordField = _ref => {
|
|
|
19
19
|
field,
|
|
20
20
|
input,
|
|
21
21
|
classes = {},
|
|
22
|
+
dataTestId,
|
|
22
23
|
ValidationPassedIcon,
|
|
23
24
|
ValidationFailedIcon,
|
|
24
25
|
NoValueIcon,
|
|
@@ -40,6 +41,7 @@ const UTPasswordField = _ref => {
|
|
|
40
41
|
validationContainer
|
|
41
42
|
} = classes;
|
|
42
43
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTTextInput.default, _extends({
|
|
44
|
+
dataTestId: dataTestId,
|
|
43
45
|
field: field,
|
|
44
46
|
input: input,
|
|
45
47
|
meta: !showValidations ? meta : undefined,
|
|
@@ -70,6 +72,7 @@ UTPasswordField.propTypes = {
|
|
|
70
72
|
field: _formTypes.fieldType,
|
|
71
73
|
input: _formTypes.inputPropTypes,
|
|
72
74
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
75
|
+
dataTestId: _propTypes.string,
|
|
73
76
|
variant: _propTypes.string,
|
|
74
77
|
ValidationPassedIcon: _propTypes.elementType,
|
|
75
78
|
ValidationFailedIcon: _propTypes.elementType,
|
|
@@ -174,6 +174,7 @@ class UTPhoneInput extends _react.PureComponent {
|
|
|
174
174
|
render() {
|
|
175
175
|
var _field$configuration, _field$configuration2;
|
|
176
176
|
const {
|
|
177
|
+
areaCodeDataTestId,
|
|
177
178
|
areaCodeFieldProps,
|
|
178
179
|
phoneNumberFieldProps,
|
|
179
180
|
field,
|
|
@@ -181,6 +182,7 @@ class UTPhoneInput extends _react.PureComponent {
|
|
|
181
182
|
disabled,
|
|
182
183
|
meta,
|
|
183
184
|
classes: themeClasses = {},
|
|
185
|
+
phoneNumberDataTestId,
|
|
184
186
|
placeholder,
|
|
185
187
|
label,
|
|
186
188
|
variant,
|
|
@@ -219,6 +221,9 @@ class UTPhoneInput extends _react.PureComponent {
|
|
|
219
221
|
InputProps: {
|
|
220
222
|
classes: {
|
|
221
223
|
input: inputClassName
|
|
224
|
+
},
|
|
225
|
+
inputProps: {
|
|
226
|
+
'data-testid': areaCodeDataTestId
|
|
222
227
|
}
|
|
223
228
|
}
|
|
224
229
|
}, areaCodeFieldProps)), /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
@@ -249,6 +254,9 @@ class UTPhoneInput extends _react.PureComponent {
|
|
|
249
254
|
InputProps: {
|
|
250
255
|
classes: {
|
|
251
256
|
input: inputClassName
|
|
257
|
+
},
|
|
258
|
+
inputProps: {
|
|
259
|
+
'data-testid': phoneNumberDataTestId
|
|
252
260
|
}
|
|
253
261
|
}
|
|
254
262
|
}, phoneNumberFieldProps)))), (error || (0, _form.shouldShowErrors)(meta)) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
@@ -277,7 +285,9 @@ UTPhoneInput.propTypes = {
|
|
|
277
285
|
variant: _propTypes.string,
|
|
278
286
|
inputClassName: _propTypes.string,
|
|
279
287
|
areaCodeFieldProps: _propTypes.object,
|
|
280
|
-
phoneNumberFieldProps: _propTypes.object
|
|
288
|
+
phoneNumberFieldProps: _propTypes.object,
|
|
289
|
+
areaCodeDataTestId: _propTypes.string,
|
|
290
|
+
phoneNumberDataTestId: _propTypes.string
|
|
281
291
|
};
|
|
282
292
|
UTPhoneInput.defaultProps = {
|
|
283
293
|
classes: {},
|
|
@@ -20,6 +20,7 @@ const UTStatus = _ref => {
|
|
|
20
20
|
classes,
|
|
21
21
|
className,
|
|
22
22
|
Icon,
|
|
23
|
+
labelDataTestId,
|
|
23
24
|
size,
|
|
24
25
|
title,
|
|
25
26
|
type,
|
|
@@ -34,6 +35,7 @@ const UTStatus = _ref => {
|
|
|
34
35
|
className: classes.icon
|
|
35
36
|
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
36
37
|
className: classes.label,
|
|
38
|
+
dataTestId: labelDataTestId,
|
|
37
39
|
variant: _constants.SIZES[size] || _constants.SIZES[_constants.DEFAULT_PROPS.size],
|
|
38
40
|
colorTheme: (0, _theme.getLabelTheme)((0, _theme.validateProps)({
|
|
39
41
|
type,
|
|
@@ -47,6 +49,7 @@ UTStatus.propTypes = {
|
|
|
47
49
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
48
50
|
className: _propTypes.string,
|
|
49
51
|
Icon: _propTypes.elementType,
|
|
52
|
+
labelDataTestId: _propTypes.string,
|
|
50
53
|
size: _propTypes.string,
|
|
51
54
|
title: _propTypes.string,
|
|
52
55
|
type: _propTypes.string,
|
|
@@ -57,6 +57,7 @@ const UTTable = _ref => {
|
|
|
57
57
|
initialSelectedRows = [],
|
|
58
58
|
integrationType = _UTTable.INTEGRATION_TYPES.INTERNAL,
|
|
59
59
|
loading,
|
|
60
|
+
noResultDataTestId,
|
|
60
61
|
noResultsLabel = _constants.NO_RESULTS_LABEL,
|
|
61
62
|
onOrderChange,
|
|
62
63
|
onPageChange,
|
|
@@ -199,7 +200,8 @@ const UTTable = _ref => {
|
|
|
199
200
|
width: tableWidth
|
|
200
201
|
}
|
|
201
202
|
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
202
|
-
className: classes.noResultsLabel
|
|
203
|
+
className: classes.noResultsLabel,
|
|
204
|
+
dataTestId: noResultDataTestId
|
|
203
205
|
}, noResultsLabel)) : currentRows.map((row, index) => {
|
|
204
206
|
const isSelected = selectedRows.includes(row[rowKey]);
|
|
205
207
|
const selectedClassNames = isSelected ? classes.selectedRow : rowSpacing === _constants.ROW_SPACING_NAMES.NONE && index < currentRows.length - 1 ? _stylesModule.default.unselectedSmallRow : undefined;
|
|
@@ -336,6 +338,7 @@ UTTable.propTypes = {
|
|
|
336
338
|
initialSelectedRows: (0, _propTypes.arrayOf)((0, _propTypes.oneOfType)([_propTypes.number, _propTypes.string])),
|
|
337
339
|
integrationType: (0, _propTypes.oneOf)([...Object.values(_UTTable.INTEGRATION_TYPES)]),
|
|
338
340
|
loading: _propTypes.bool,
|
|
341
|
+
noResultDataTestId: _propTypes.string,
|
|
339
342
|
noResultsLabel: _propTypes.string,
|
|
340
343
|
onOrderChange: _propTypes.func,
|
|
341
344
|
onPageChange: _propTypes.func,
|
|
@@ -21,6 +21,7 @@ const UTTextArea = _ref => {
|
|
|
21
21
|
let {
|
|
22
22
|
classes,
|
|
23
23
|
classNames = {},
|
|
24
|
+
dataTestId,
|
|
24
25
|
disabled,
|
|
25
26
|
field,
|
|
26
27
|
HelpIcon,
|
|
@@ -62,6 +63,7 @@ const UTTextArea = _ref => {
|
|
|
62
63
|
className: _stylesModule.default.componentWrapper
|
|
63
64
|
}, /*#__PURE__*/_react.default.createElement("textarea", _extends({}, inputProps, {
|
|
64
65
|
className: "".concat(_stylesModule.default.textarea, " ").concat(textarea, " ").concat(classes.textarea),
|
|
66
|
+
"data-testid": dataTestId,
|
|
65
67
|
onChange: handleOnChange,
|
|
66
68
|
onBlur: onBlur,
|
|
67
69
|
onFocus: onFocus,
|
|
@@ -87,6 +89,7 @@ UTTextArea.propTypes = {
|
|
|
87
89
|
textarea: _propTypes.string,
|
|
88
90
|
textAreaContainer: _propTypes.string
|
|
89
91
|
}),
|
|
92
|
+
dataTestId: _propTypes.string,
|
|
90
93
|
disabled: _propTypes.bool,
|
|
91
94
|
field: _formTypes.fieldType,
|
|
92
95
|
HelpIcon: _propTypes.elementType,
|
|
@@ -52,6 +52,7 @@ class UTTextInput extends _react.PureComponent {
|
|
|
52
52
|
captionLabel,
|
|
53
53
|
classes,
|
|
54
54
|
containerClassName,
|
|
55
|
+
dataTestId,
|
|
55
56
|
disabled,
|
|
56
57
|
field,
|
|
57
58
|
id,
|
|
@@ -141,6 +142,9 @@ class UTTextInput extends _react.PureComponent {
|
|
|
141
142
|
autoComplete: "off",
|
|
142
143
|
InputProps: {
|
|
143
144
|
id: fieldId,
|
|
145
|
+
inputProps: {
|
|
146
|
+
'data-testid': dataTestId
|
|
147
|
+
},
|
|
144
148
|
endAdornment: endAction && /*#__PURE__*/_react.default.createElement(_InputAdornment.default, {
|
|
145
149
|
position: "end",
|
|
146
150
|
className: "".concat(adornmentInside && _stylesModule.default.adornmentInside)
|
|
@@ -178,6 +182,7 @@ UTTextInput.propTypes = {
|
|
|
178
182
|
captionLabel: _propTypes.string,
|
|
179
183
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
180
184
|
containerClassName: _propTypes.string,
|
|
185
|
+
dataTestId: _propTypes.string,
|
|
181
186
|
disabled: _propTypes.bool,
|
|
182
187
|
field: _propTypes.object,
|
|
183
188
|
id: _propTypes.string,
|
|
@@ -41,6 +41,7 @@ const UTGoogleAutocompletePropTypes = exports.UTGoogleAutocompletePropTypes = {
|
|
|
41
41
|
alert: _propTypes.string,
|
|
42
42
|
apikey: _propTypes.string,
|
|
43
43
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
44
|
+
dataTestId: _propTypes.string,
|
|
44
45
|
detailErrorLabel: _propTypes.string,
|
|
45
46
|
inputProps: _propTypes.object,
|
|
46
47
|
minChar: _propTypes.number,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@widergy/energy-ui",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.26.0",
|
|
4
4
|
"description": "Widergy Web Components",
|
|
5
5
|
"author": "widergy",
|
|
6
6
|
"license": "MIT",
|
|
@@ -92,7 +92,8 @@
|
|
|
92
92
|
},
|
|
93
93
|
"resolutions": {
|
|
94
94
|
"@babel/preset-env": "^7.8.7",
|
|
95
|
-
"caniuse-lite": "1.0.30001632"
|
|
95
|
+
"caniuse-lite": "1.0.30001632",
|
|
96
|
+
"react-error-overlay": "6.0.9"
|
|
96
97
|
},
|
|
97
98
|
"browserslist": [
|
|
98
99
|
">0.2%",
|