@widergy/energy-ui 3.62.0 → 3.63.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/UTAttachment/index.js +9 -0
- package/dist/components/UTAttachment/layout.js +10 -1
- package/dist/components/UTAttachmentList/index.js +10 -1
- package/dist/components/UTAttachmentList/layout.js +12 -3
- package/dist/components/UTCheckList/versions/V1/index.js +1 -0
- package/dist/components/UTFileInput/layout.js +29 -26
- package/dist/components/UTImageRadio/components/ImageRadioCard/index.js +11 -8
- package/dist/components/UTImageRadio/index.js +24 -21
- package/dist/components/UTPhoneInput/versions/V1/index.js +3 -0
- package/dist/components/UTRadioGroup/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
# [3.63.0](https://github.com/widergy/energy-ui/compare/v3.62.0...v3.63.0) (2025-02-21)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [AUT-606] forms ids ([#581](https://github.com/widergy/energy-ui/issues/581)) ([b2714cf](https://github.com/widergy/energy-ui/commit/b2714cfb1df898fc1566e63cee26f1883588367a))
|
|
7
|
+
|
|
1
8
|
# [3.62.0](https://github.com/widergy/energy-ui/compare/v3.61.1...v3.62.0) (2025-02-21)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -162,6 +162,8 @@ class AttachmentContainer extends _react.Component {
|
|
|
162
162
|
actions,
|
|
163
163
|
classes,
|
|
164
164
|
containerClassname,
|
|
165
|
+
dataTestId,
|
|
166
|
+
deleteDataTestId,
|
|
165
167
|
disabled,
|
|
166
168
|
errorClassname,
|
|
167
169
|
field,
|
|
@@ -171,6 +173,7 @@ class AttachmentContainer extends _react.Component {
|
|
|
171
173
|
input,
|
|
172
174
|
loadingTextClassname,
|
|
173
175
|
previewClassname,
|
|
176
|
+
previewDataTestId,
|
|
174
177
|
previewProps,
|
|
175
178
|
RemoveIcon,
|
|
176
179
|
removeFileClassname,
|
|
@@ -189,6 +192,8 @@ class AttachmentContainer extends _react.Component {
|
|
|
189
192
|
actions: actions,
|
|
190
193
|
classes: classes,
|
|
191
194
|
containerClassname: containerClassname,
|
|
195
|
+
dataTestId: dataTestId,
|
|
196
|
+
deleteDataTestId: deleteDataTestId,
|
|
192
197
|
disabled: disabled,
|
|
193
198
|
error: error,
|
|
194
199
|
errorClassname: errorClassname,
|
|
@@ -204,6 +209,7 @@ class AttachmentContainer extends _react.Component {
|
|
|
204
209
|
onClick: this.removeValue,
|
|
205
210
|
preview: preview,
|
|
206
211
|
previewClassname: previewClassname,
|
|
212
|
+
previewDataTestId: previewDataTestId,
|
|
207
213
|
previewProps: previewProps,
|
|
208
214
|
removeFileClassname: removeFileClassname,
|
|
209
215
|
RemoveIcon: RemoveIcon,
|
|
@@ -224,6 +230,8 @@ AttachmentContainer.propTypes = {
|
|
|
224
230
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
225
231
|
containerClassname: _propTypes.string,
|
|
226
232
|
customValidation: _propTypes.func,
|
|
233
|
+
dataTestId: _propTypes.string,
|
|
234
|
+
deleteDataTestId: _propTypes.string,
|
|
227
235
|
disableResize: _propTypes.bool,
|
|
228
236
|
disabled: _propTypes.bool,
|
|
229
237
|
errorClassname: _propTypes.string,
|
|
@@ -242,6 +250,7 @@ AttachmentContainer.propTypes = {
|
|
|
242
250
|
onChange: _propTypes.func,
|
|
243
251
|
onLoaded: _propTypes.func,
|
|
244
252
|
previewClassname: _propTypes.string,
|
|
253
|
+
previewDataTestId: _propTypes.string,
|
|
245
254
|
previewProps: _constants.previewPropType,
|
|
246
255
|
removeFileClassname: _propTypes.string,
|
|
247
256
|
RemoveIcon: _propTypes.elementType,
|
|
@@ -26,6 +26,8 @@ const Attachment = _ref => {
|
|
|
26
26
|
actions,
|
|
27
27
|
classes,
|
|
28
28
|
containerClassname,
|
|
29
|
+
dataTestId,
|
|
30
|
+
deleteDataTestId,
|
|
29
31
|
disabled,
|
|
30
32
|
error,
|
|
31
33
|
errorClassname,
|
|
@@ -41,6 +43,7 @@ const Attachment = _ref => {
|
|
|
41
43
|
onClick,
|
|
42
44
|
preview,
|
|
43
45
|
previewClassname,
|
|
46
|
+
previewDataTestId,
|
|
44
47
|
previewProps,
|
|
45
48
|
removeFileClassname,
|
|
46
49
|
RemoveIcon,
|
|
@@ -57,7 +60,8 @@ const Attachment = _ref => {
|
|
|
57
60
|
size: titleVariant,
|
|
58
61
|
required: field.required
|
|
59
62
|
}, field === null || field === void 0 ? void 0 : field.title), name && !loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
-
className: "".concat(_stylesModule.default.previewContainer, " ").concat(previewClassname)
|
|
63
|
+
className: "".concat(_stylesModule.default.previewContainer, " ").concat(previewClassname),
|
|
64
|
+
"data-testid": previewDataTestId
|
|
61
65
|
}, /*#__PURE__*/_react.default.createElement(_Preview.default, {
|
|
62
66
|
preview: preview,
|
|
63
67
|
previewProps: previewProps
|
|
@@ -71,6 +75,7 @@ const Attachment = _ref => {
|
|
|
71
75
|
classNames: {
|
|
72
76
|
root: "".concat(_stylesModule.default.removeIconContainer, " ").concat(removeFileClassname)
|
|
73
77
|
},
|
|
78
|
+
dataTestId: deleteDataTestId,
|
|
74
79
|
disabled: disabled,
|
|
75
80
|
Icon: Icon,
|
|
76
81
|
onClick: onClick,
|
|
@@ -84,6 +89,7 @@ const Attachment = _ref => {
|
|
|
84
89
|
error: error,
|
|
85
90
|
loadingTextClassname: loadingTextClassname,
|
|
86
91
|
classes: classes,
|
|
92
|
+
dataTestId: dataTestId,
|
|
87
93
|
errorClassname: errorClassname,
|
|
88
94
|
errorText: errorText,
|
|
89
95
|
icon: icon,
|
|
@@ -96,6 +102,8 @@ Attachment.propTypes = {
|
|
|
96
102
|
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
97
103
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
98
104
|
containerClassname: _propTypes.string,
|
|
105
|
+
dataTestId: _propTypes.string,
|
|
106
|
+
deleteDataTestId: _propTypes.string,
|
|
99
107
|
disabled: _propTypes.bool,
|
|
100
108
|
error: _propTypes.bool,
|
|
101
109
|
errorClassname: _propTypes.string,
|
|
@@ -114,6 +122,7 @@ Attachment.propTypes = {
|
|
|
114
122
|
type: _propTypes.string
|
|
115
123
|
}),
|
|
116
124
|
previewClassname: _propTypes.string,
|
|
125
|
+
previewDataTestId: _propTypes.string,
|
|
117
126
|
previewProps: _constants.previewPropType,
|
|
118
127
|
removeFileClassname: _propTypes.string,
|
|
119
128
|
RemoveIcon: _propTypes.elementType,
|
|
@@ -26,6 +26,8 @@ const AttachmentContainer = _ref => {
|
|
|
26
26
|
classes,
|
|
27
27
|
containerClassname,
|
|
28
28
|
customValidation,
|
|
29
|
+
dataTestId,
|
|
30
|
+
deleteDataTestId,
|
|
29
31
|
disabled,
|
|
30
32
|
disableResize,
|
|
31
33
|
errorClassname,
|
|
@@ -36,6 +38,7 @@ const AttachmentContainer = _ref => {
|
|
|
36
38
|
loadingTextClassname,
|
|
37
39
|
maxFileSize: defaultMaxFileSize = 99999999,
|
|
38
40
|
onLoaded,
|
|
41
|
+
previewDataTestId,
|
|
39
42
|
resizeConfig,
|
|
40
43
|
sanitize
|
|
41
44
|
} = _ref;
|
|
@@ -200,6 +203,8 @@ const AttachmentContainer = _ref => {
|
|
|
200
203
|
classes: classes,
|
|
201
204
|
containerClassname: containerClassname,
|
|
202
205
|
disabled: disabled,
|
|
206
|
+
dataTestId: dataTestId,
|
|
207
|
+
deleteDataTestId: deleteDataTestId,
|
|
203
208
|
error: error,
|
|
204
209
|
errorClassname: errorClassname,
|
|
205
210
|
errorText: errorText,
|
|
@@ -211,7 +216,8 @@ const AttachmentContainer = _ref => {
|
|
|
211
216
|
maxFiles: maxFiles,
|
|
212
217
|
maxFileSize: (0, _utils.getSizeInMB)(maxFileSize),
|
|
213
218
|
onChange: onChange,
|
|
214
|
-
preview: preview
|
|
219
|
+
preview: preview,
|
|
220
|
+
previewDataTestId: previewDataTestId
|
|
215
221
|
});
|
|
216
222
|
};
|
|
217
223
|
AttachmentContainer.propTypes = {
|
|
@@ -226,6 +232,8 @@ AttachmentContainer.propTypes = {
|
|
|
226
232
|
containerClassname: _propTypes.string,
|
|
227
233
|
customValidation: _propTypes.func,
|
|
228
234
|
disabled: _propTypes.bool,
|
|
235
|
+
dataTestId: _propTypes.string,
|
|
236
|
+
deleteDataTestId: _propTypes.string,
|
|
229
237
|
disableResize: _propTypes.bool,
|
|
230
238
|
errorClassname: _propTypes.string,
|
|
231
239
|
field: _propTypes.any,
|
|
@@ -240,6 +248,7 @@ AttachmentContainer.propTypes = {
|
|
|
240
248
|
loadingTextClassname: _propTypes.string,
|
|
241
249
|
maxFileSize: _propTypes.number,
|
|
242
250
|
onLoaded: _propTypes.func,
|
|
251
|
+
previewDataTestId: _propTypes.string,
|
|
243
252
|
resizeConfig: (0, _propTypes.shape)({
|
|
244
253
|
type: _propTypes.string,
|
|
245
254
|
maxWidth: _propTypes.number,
|
|
@@ -112,16 +112,19 @@ const Attachment = _ref => {
|
|
|
112
112
|
let {
|
|
113
113
|
acceptedFileTypes,
|
|
114
114
|
classes,
|
|
115
|
+
dataTestId,
|
|
116
|
+
deleteDataTestId,
|
|
115
117
|
disabled,
|
|
116
118
|
error,
|
|
117
119
|
errorText,
|
|
118
120
|
fieldTypes,
|
|
119
121
|
fileInputRef,
|
|
120
122
|
helpText,
|
|
121
|
-
maxFiles,
|
|
122
123
|
maxFileSize,
|
|
124
|
+
maxFiles,
|
|
123
125
|
onChange,
|
|
124
126
|
preview,
|
|
127
|
+
previewDataTestId,
|
|
125
128
|
RemoveIcon
|
|
126
129
|
} = _ref;
|
|
127
130
|
const fieldType = acceptedFileTypes || fieldTypes.map(type => _files.inputFiles[type].inputType).join();
|
|
@@ -138,7 +141,8 @@ const Attachment = _ref => {
|
|
|
138
141
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
139
142
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container, " ").concat(error && classes.errorContainer)
|
|
140
143
|
}, !previewIsEmpty && preview.map(previewItem => /*#__PURE__*/_react.default.createElement("div", {
|
|
141
|
-
className: "".concat(_stylesModule.default.previewContainer, " ").concat(classes.previewContainer)
|
|
144
|
+
className: "".concat(_stylesModule.default.previewContainer, " ").concat(classes.previewContainer),
|
|
145
|
+
"data-testid": previewDataTestId
|
|
142
146
|
}, previewItem.src ? /*#__PURE__*/_react.default.createElement(_Preview.default, {
|
|
143
147
|
classes: classes,
|
|
144
148
|
preview: previewItem,
|
|
@@ -172,6 +176,7 @@ const Attachment = _ref => {
|
|
|
172
176
|
root: preview.removeFileClassnames,
|
|
173
177
|
icon: classes.actionNeutralIcon
|
|
174
178
|
},
|
|
179
|
+
dataTestId: deleteDataTestId,
|
|
175
180
|
disabled: disabled,
|
|
176
181
|
Icon: Icon,
|
|
177
182
|
onClick: previewItem.onClick,
|
|
@@ -194,6 +199,7 @@ const Attachment = _ref => {
|
|
|
194
199
|
}
|
|
195
200
|
}, _constants.UPLOAD_FILE), isUploadFileAvailable && /*#__PURE__*/_react.default.createElement("input", {
|
|
196
201
|
className: _stylesModule.default.input,
|
|
202
|
+
"data-testid": dataTestId,
|
|
197
203
|
accept: fieldType,
|
|
198
204
|
ref: fileInputRef,
|
|
199
205
|
type: "file",
|
|
@@ -224,6 +230,8 @@ const Attachment = _ref => {
|
|
|
224
230
|
Attachment.propTypes = {
|
|
225
231
|
acceptedFileTypes: _propTypes.string,
|
|
226
232
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
233
|
+
dataTestId: _propTypes.string,
|
|
234
|
+
deleteDataTestId: _propTypes.string,
|
|
227
235
|
disabled: _propTypes.bool,
|
|
228
236
|
error: _propTypes.bool,
|
|
229
237
|
errorText: _propTypes.string,
|
|
@@ -232,13 +240,14 @@ Attachment.propTypes = {
|
|
|
232
240
|
current: (0, _propTypes.instanceOf)(Element)
|
|
233
241
|
})),
|
|
234
242
|
helpText: _propTypes.string,
|
|
235
|
-
maxFiles: _propTypes.number,
|
|
236
243
|
maxFileSize: _propTypes.number,
|
|
244
|
+
maxFiles: _propTypes.number,
|
|
237
245
|
onChange: _propTypes.func,
|
|
238
246
|
preview: (0, _propTypes.shape)({
|
|
239
247
|
src: _propTypes.string,
|
|
240
248
|
type: _propTypes.string
|
|
241
249
|
}),
|
|
250
|
+
previewDataTestId: _propTypes.string,
|
|
242
251
|
previewProps: _constants.previewPropType,
|
|
243
252
|
RemoveIcon: _propTypes.elementType
|
|
244
253
|
};
|
|
@@ -103,6 +103,7 @@ const UTCheckList = _ref => {
|
|
|
103
103
|
className: "".concat(_stylesModule.default.checkboxesContainer, " ").concat(smallVerticalSpacingClass, " ").concat(variant === _constants.BUTTON_VARIANT && _stylesModule.default.buttonVariant, " ").concat(classNames.checkboxesContainer)
|
|
104
104
|
}, showSelectAll && !isSimple && /*#__PURE__*/_react.default.createElement(_UTCheckbox.default, {
|
|
105
105
|
className: classNames.selectAll,
|
|
106
|
+
dataTestId: itemDataTestId ? "".concat(itemDataTestId, ".selectAll") : null,
|
|
106
107
|
disabled: disabled,
|
|
107
108
|
indeterminate: isIndeterminate,
|
|
108
109
|
onChange: handleCheckAll,
|
|
@@ -50,21 +50,22 @@ class UTFileInput extends _react.PureComponent {
|
|
|
50
50
|
}
|
|
51
51
|
render() {
|
|
52
52
|
const {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
fileType,
|
|
53
|
+
classes,
|
|
54
|
+
containerClassname,
|
|
55
|
+
dataTestId,
|
|
56
|
+
disabled,
|
|
58
57
|
error,
|
|
58
|
+
errorClassname,
|
|
59
59
|
errorText,
|
|
60
|
+
fileType,
|
|
60
61
|
icon: Icon,
|
|
61
|
-
uploadingText,
|
|
62
|
-
classes,
|
|
63
|
-
loadingTextClassname,
|
|
64
62
|
inputClassname,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
label,
|
|
64
|
+
loading,
|
|
65
|
+
loadingTextClassname,
|
|
66
|
+
name,
|
|
67
|
+
onChange,
|
|
68
|
+
uploadingText
|
|
68
69
|
} = this.props;
|
|
69
70
|
const UploadImage = uploadIcon;
|
|
70
71
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -85,12 +86,13 @@ class UTFileInput extends _react.PureComponent {
|
|
|
85
86
|
variant: "small",
|
|
86
87
|
className: "".concat(_stylesModule.default.label, " ").concat(classes.fileInputLabel)
|
|
87
88
|
}, label)), /*#__PURE__*/_react.default.createElement("input", {
|
|
88
|
-
className: "".concat(_stylesModule.default.input, " ").concat(inputClassname),
|
|
89
89
|
accept: fileType,
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
className: "".concat(_stylesModule.default.input, " ").concat(inputClassname),
|
|
91
|
+
"data-testid": dataTestId,
|
|
92
|
+
disabled: disabled,
|
|
92
93
|
name: name,
|
|
93
|
-
|
|
94
|
+
onChange: onChange,
|
|
95
|
+
type: "file"
|
|
94
96
|
})), error && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
95
97
|
className: errorClassname,
|
|
96
98
|
colorTheme: "error",
|
|
@@ -103,20 +105,21 @@ UTFileInput.defaultProps = {
|
|
|
103
105
|
uploadingText: _constants.UPLOADING
|
|
104
106
|
};
|
|
105
107
|
UTFileInput.propTypes = {
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
onChange: _propTypes.func.isRequired,
|
|
110
|
-
loading: _propTypes.bool,
|
|
111
|
-
fileType: _propTypes.string,
|
|
112
|
-
error: _propTypes.bool,
|
|
108
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
109
|
+
containerClassname: _propTypes.string,
|
|
110
|
+
dataTestId: _propTypes.string,
|
|
113
111
|
disabled: _propTypes.bool,
|
|
112
|
+
error: _propTypes.bool,
|
|
113
|
+
errorClassname: _propTypes.string,
|
|
114
114
|
errorText: _propTypes.string,
|
|
115
|
+
fileType: _propTypes.string,
|
|
115
116
|
icon: _propTypes.string,
|
|
116
|
-
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
117
|
-
loadingTextClassname: _propTypes.string,
|
|
118
117
|
inputClassname: _propTypes.string,
|
|
119
|
-
|
|
120
|
-
|
|
118
|
+
label: _propTypes.string,
|
|
119
|
+
loading: _propTypes.bool,
|
|
120
|
+
loadingTextClassname: _propTypes.string,
|
|
121
|
+
name: _propTypes.string,
|
|
122
|
+
onChange: _propTypes.func.isRequired,
|
|
123
|
+
uploadingText: _propTypes.string
|
|
121
124
|
};
|
|
122
125
|
var _default = exports.default = UTFileInput;
|
|
@@ -16,13 +16,14 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
16
16
|
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; }
|
|
17
17
|
const ImageRadioCard = _ref => {
|
|
18
18
|
let {
|
|
19
|
-
|
|
19
|
+
classes,
|
|
20
20
|
compact,
|
|
21
|
-
|
|
21
|
+
dataTestId,
|
|
22
|
+
disabled,
|
|
22
23
|
isSelected,
|
|
23
24
|
onChange,
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
oneColumn,
|
|
26
|
+
option = {},
|
|
26
27
|
variant = {}
|
|
27
28
|
} = _ref;
|
|
28
29
|
const {
|
|
@@ -53,6 +54,7 @@ const ImageRadioCard = _ref => {
|
|
|
53
54
|
}), [imageUrl, selectedImageUrl]);
|
|
54
55
|
const Content = () => /*#__PURE__*/_react.default.createElement(_UTTouchableWithoutFeedback.default, {
|
|
55
56
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.containerCard, " ").concat(isSelected && "".concat(_stylesModule.default.isSelected, " ").concat(classes.isSelected), " ").concat(oneColumn && _stylesModule.default.oneColumn, " ").concat(compact && _stylesModule.default.compact, " ").concat(disabled && _stylesModule.default.disabled, " ").concat(transparent && _stylesModule.default.transparent, " ").concat(vertical && classes.vertical, " ").concat(tooltip && _stylesModule.default.contentWithTooltip, " "),
|
|
57
|
+
dataTestId: dataTestId,
|
|
56
58
|
onClick: handleOnChange
|
|
57
59
|
}, (imageUrl || ImageComponent) && /*#__PURE__*/_react.default.createElement("div", {
|
|
58
60
|
className: "".concat(classes.image, " ").concat(_stylesModule.default.image)
|
|
@@ -74,16 +76,17 @@ const ImageRadioCard = _ref => {
|
|
|
74
76
|
}, /*#__PURE__*/_react.default.createElement(Content, null))) : /*#__PURE__*/_react.default.createElement(Content, null);
|
|
75
77
|
};
|
|
76
78
|
ImageRadioCard.propTypes = {
|
|
77
|
-
|
|
78
|
-
disabled: _propTypes.bool,
|
|
79
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
79
80
|
compact: _propTypes.bool,
|
|
81
|
+
dataTestId: _propTypes.string,
|
|
82
|
+
disabled: _propTypes.bool,
|
|
80
83
|
isSelected: _propTypes.bool,
|
|
81
84
|
onChange: _propTypes.func.isRequired,
|
|
82
85
|
oneColumn: _propTypes.bool,
|
|
86
|
+
option: _types.optionType,
|
|
83
87
|
variant: (0, _propTypes.shape)({
|
|
84
88
|
layout: _propTypes.string,
|
|
85
89
|
transparent_background: _propTypes.bool
|
|
86
|
-
})
|
|
87
|
-
classes: (0, _propTypes.objectOf)(_propTypes.string)
|
|
90
|
+
})
|
|
88
91
|
};
|
|
89
92
|
var _default = exports.default = /*#__PURE__*/(0, _react.memo)(ImageRadioCard);
|
|
@@ -23,17 +23,18 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
23
23
|
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; }
|
|
24
24
|
const UTImageRadio = _ref => {
|
|
25
25
|
let {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
leftAligned,
|
|
26
|
+
classNames,
|
|
27
|
+
classes: themeClasses,
|
|
29
28
|
compact,
|
|
30
|
-
|
|
29
|
+
dataTestId,
|
|
30
|
+
disabled,
|
|
31
31
|
field,
|
|
32
|
+
input = {},
|
|
33
|
+
leftAligned,
|
|
32
34
|
meta,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
classes: themeClasses
|
|
35
|
+
oneColumn,
|
|
36
|
+
oneColumnBreakpoint = _constants.DEFAULT_ONE_COLUMN_BREAKPOINT,
|
|
37
|
+
options = []
|
|
37
38
|
} = _ref;
|
|
38
39
|
const mutableOptions = [...options];
|
|
39
40
|
const {
|
|
@@ -49,16 +50,17 @@ const UTImageRadio = _ref => {
|
|
|
49
50
|
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
50
51
|
ref: containerRef,
|
|
51
52
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container, " ").concat(alignToLeft && _stylesModule.default.leftAligned)
|
|
52
|
-
}, mutableOptions.sort(_utils.sortOptions).map(item => /*#__PURE__*/_react.default.createElement(_ImageRadioCard.default, {
|
|
53
|
-
|
|
54
|
-
option: item,
|
|
55
|
-
variant: field === null || field === void 0 ? void 0 : field.configuration,
|
|
53
|
+
}, mutableOptions.sort(_utils.sortOptions).map((item, i) => /*#__PURE__*/_react.default.createElement(_ImageRadioCard.default, {
|
|
54
|
+
classes: classes,
|
|
56
55
|
compact: compact,
|
|
56
|
+
dataTestId: "".concat(dataTestId).concat(i),
|
|
57
57
|
disabled: disabled,
|
|
58
|
-
oneColumn: oneColumn || containerWidth < oneColumnBreakpoint,
|
|
59
58
|
isSelected: value === item.value,
|
|
59
|
+
key: item.value,
|
|
60
60
|
onChange: onChange,
|
|
61
|
-
|
|
61
|
+
oneColumn: oneColumn || containerWidth < oneColumnBreakpoint,
|
|
62
|
+
option: item,
|
|
63
|
+
variant: field === null || field === void 0 ? void 0 : field.configuration
|
|
62
64
|
}))), meta && (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
63
65
|
colorTheme: "error",
|
|
64
66
|
className: _stylesModule.default.error,
|
|
@@ -66,16 +68,17 @@ const UTImageRadio = _ref => {
|
|
|
66
68
|
}, meta.error));
|
|
67
69
|
};
|
|
68
70
|
UTImageRadio.propTypes = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
72
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
71
73
|
compact: _propTypes.bool,
|
|
72
|
-
|
|
73
|
-
oneColumn: _propTypes.bool,
|
|
74
|
-
field: _formTypes.fieldType,
|
|
74
|
+
dataTestId: _propTypes.string,
|
|
75
75
|
disabled: _propTypes.bool,
|
|
76
|
+
field: _formTypes.fieldType,
|
|
76
77
|
input: _formTypes.inputPropTypes,
|
|
78
|
+
leftAligned: _propTypes.bool,
|
|
77
79
|
meta: _formTypes.metaPropTypes,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
+
oneColumn: _propTypes.bool,
|
|
81
|
+
oneColumnBreakpoint: _propTypes.number,
|
|
82
|
+
options: (0, _propTypes.arrayOf)(_types.optionType)
|
|
80
83
|
};
|
|
81
84
|
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(/*#__PURE__*/(0, _react.memo)(UTImageRadio));
|
|
@@ -41,6 +41,7 @@ const UTPhoneInput = _ref => {
|
|
|
41
41
|
areaCodeWithoutZeroError: 'El código de área debe comenzar sin 0.',
|
|
42
42
|
invalidAreaCodeError: 'No pudimos reconocer el código de área ingresado. Intenta con uno diferente.'
|
|
43
43
|
},
|
|
44
|
+
validationDataTestId,
|
|
44
45
|
validations,
|
|
45
46
|
value,
|
|
46
47
|
withAreaCode = true
|
|
@@ -174,6 +175,7 @@ const UTPhoneInput = _ref => {
|
|
|
174
175
|
colorTheme: "gray",
|
|
175
176
|
variant: "small"
|
|
176
177
|
}, helpText), validationData && /*#__PURE__*/_react.default.createElement(_UTValidation.default, {
|
|
178
|
+
dataTestId: validationDataTestId,
|
|
177
179
|
validationData: validationData
|
|
178
180
|
}));
|
|
179
181
|
};
|
|
@@ -198,6 +200,7 @@ UTPhoneInput.propTypes = {
|
|
|
198
200
|
areaCodeWithoutZeroError: _propTypes.string,
|
|
199
201
|
invalidAreaCodeError: _propTypes.string
|
|
200
202
|
}),
|
|
203
|
+
validationDataTestId: _propTypes.string,
|
|
201
204
|
validations: _UTValidation.validationDataProptypes,
|
|
202
205
|
value: _propTypes.string,
|
|
203
206
|
withAreaCode: _propTypes.bool
|
|
@@ -65,7 +65,7 @@ class UTRadioGroup extends _react.PureComponent {
|
|
|
65
65
|
checked: "".concat(classes.checked, " ").concat(classes.checkedIconRoot)
|
|
66
66
|
},
|
|
67
67
|
inputProps: {
|
|
68
|
-
'data-testid': dataTestId
|
|
68
|
+
'data-testid': dataTestId ? "".concat(dataTestId, ".").concat(index) : null
|
|
69
69
|
}
|
|
70
70
|
}),
|
|
71
71
|
className: "".concat(classes.formControlLabel, " \n ").concat(this.props.divider && index === 0 && classes.topDivider, " \n ").concat(this.props.divider && classes.divider, "\n ").concat(className)
|