@widergy/energy-ui 3.59.2 → 3.60.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/UTAttachment/index.js +18 -5
- package/dist/components/UTAttachment/layout.js +50 -30
- package/dist/components/UTAttachment/styles.module.scss +4 -0
- package/dist/components/UTBadge/theme.js +1 -0
- package/dist/components/UTBaseInputField/components/ActionAdornment/index.js +10 -2
- package/dist/components/UTBreadcrumbs/index.js +1 -1
- package/dist/components/UTCheckList/versions/V1/README.MD +1 -0
- package/dist/components/UTCheckList/versions/V1/index.js +4 -0
- package/dist/components/UTCheckbox/versions/V1/README.md +1 -1
- package/dist/components/UTCheckbox/versions/V1/index.js +12 -7
- package/dist/components/UTDatePicker/index.js +26 -10
- package/dist/components/UTDatePicker/utils.js +30 -2
- package/dist/components/UTFieldLabel/index.js +33 -9
- package/dist/components/UTFieldLabel/styles.module.scss +14 -0
- package/dist/components/UTFileInput/layout.js +1 -1
- package/dist/components/UTFileInput/styles.module.scss +8 -0
- package/dist/components/UTIcon/components/EnergyIcons/EnergyIconMessageEdit.svg +6 -0
- package/dist/components/UTIcon/constants.js +30 -17
- package/dist/components/UTMenu/index.js +1 -1
- package/dist/components/UTPanel/versions/V1/constants.js +3 -2
- package/dist/components/UTPanel/versions/V1/index.js +17 -2
- package/dist/components/UTPhoneInput/versions/V1/README.md +1 -0
- package/dist/components/UTPhoneInput/versions/V1/index.js +8 -6
- package/dist/components/UTPopper/README.md +17 -0
- package/dist/components/UTPopper/index.js +50 -0
- package/dist/components/UTRadioGroup/index.js +13 -7
- package/dist/components/UTRating/versions/V1/index.js +0 -1
- package/dist/components/UTSelect/versions/V1/index.js +1 -1
- package/dist/components/UTTextInput/versions/V1/index.js +2 -4
- package/dist/index.js +7 -0
- package/dist/types/buttonTypes.js +23 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# [3.60.0](https://github.com/widergy/energy-ui/compare/v3.59.3...v3.60.0) (2025-02-13)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* [AXCH-133] ut field label as title and utpopper ([#575](https://github.com/widergy/energy-ui/issues/575)) ([70baeb5](https://github.com/widergy/energy-ui/commit/70baeb5c99d0fa3eea168b34ff572322f9cd4eaa))
|
|
7
|
+
|
|
8
|
+
## [3.59.3](https://github.com/widergy/energy-ui/compare/v3.59.2...v3.59.3) (2025-02-13)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* [UGMC-907] date range and validations ([#571](https://github.com/widergy/energy-ui/issues/571)) ([9163212](https://github.com/widergy/energy-ui/commit/9163212229edd036516d94038eb49200e1b177c5))
|
|
14
|
+
|
|
1
15
|
## [3.59.2](https://github.com/widergy/energy-ui/compare/v3.59.1...v3.59.2) (2025-02-13)
|
|
2
16
|
|
|
3
17
|
|
|
@@ -11,6 +11,7 @@ var _image = require("@widergy/web-utils/lib/image");
|
|
|
11
11
|
var _browser = require("@widergy/web-utils/lib/browser");
|
|
12
12
|
var _array = require("@widergy/web-utils/lib/array");
|
|
13
13
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
14
|
+
var _buttonTypes = require("../../types/buttonTypes");
|
|
14
15
|
var _theme = require("./theme");
|
|
15
16
|
var _constants = require("./constants");
|
|
16
17
|
var _layout = _interopRequireDefault(require("./layout"));
|
|
@@ -158,18 +159,22 @@ class AttachmentContainer extends _react.Component {
|
|
|
158
159
|
render() {
|
|
159
160
|
const {
|
|
160
161
|
acceptedFileTypes,
|
|
162
|
+
actions,
|
|
161
163
|
classes,
|
|
162
164
|
containerClassname,
|
|
163
165
|
disabled,
|
|
164
166
|
errorClassname,
|
|
167
|
+
field,
|
|
165
168
|
fieldTypes,
|
|
169
|
+
hideLabels,
|
|
166
170
|
icon,
|
|
167
171
|
input,
|
|
168
172
|
loadingTextClassname,
|
|
169
173
|
previewClassname,
|
|
170
174
|
previewProps,
|
|
171
175
|
RemoveIcon,
|
|
172
|
-
removeFileClassname
|
|
176
|
+
removeFileClassname,
|
|
177
|
+
titleVariant
|
|
173
178
|
} = this.props;
|
|
174
179
|
const {
|
|
175
180
|
name,
|
|
@@ -181,30 +186,35 @@ class AttachmentContainer extends _react.Component {
|
|
|
181
186
|
const loadingDefaultValue = this.hasDefaultValueToLoad() && !name;
|
|
182
187
|
return /*#__PURE__*/_react.default.createElement(_layout.default, {
|
|
183
188
|
acceptedFileTypes: acceptedFileTypes,
|
|
189
|
+
actions: actions,
|
|
184
190
|
classes: classes,
|
|
185
191
|
containerClassname: containerClassname,
|
|
186
192
|
disabled: disabled,
|
|
187
193
|
error: error,
|
|
188
194
|
errorClassname: errorClassname,
|
|
189
195
|
errorText: errorText,
|
|
196
|
+
field: field,
|
|
190
197
|
fieldTypes: fieldTypes,
|
|
198
|
+
hideLabels: hideLabels,
|
|
191
199
|
icon: icon,
|
|
192
200
|
loading: loading || loadingDefaultValue,
|
|
193
201
|
loadingTextClassname: loadingTextClassname,
|
|
194
202
|
name: name || this.getDefaultAttachment(input.value),
|
|
203
|
+
onChange: this.onChange,
|
|
204
|
+
onClick: this.removeValue,
|
|
195
205
|
preview: preview,
|
|
196
206
|
previewClassname: previewClassname,
|
|
197
207
|
previewProps: previewProps,
|
|
198
|
-
onChange: this.onChange,
|
|
199
|
-
onClick: this.removeValue,
|
|
200
208
|
removeFileClassname: removeFileClassname,
|
|
201
209
|
RemoveIcon: RemoveIcon,
|
|
210
|
+
titleVariant: titleVariant,
|
|
202
211
|
uploadingText: loadingDefaultValue ? _constants.DEFAULT_UPLOADING_TEXT : ''
|
|
203
212
|
});
|
|
204
213
|
}
|
|
205
214
|
}
|
|
206
215
|
AttachmentContainer.propTypes = {
|
|
207
216
|
acceptedFileTypes: _propTypes.string,
|
|
217
|
+
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
208
218
|
allowedPDFUploadSizes: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
209
219
|
name: _propTypes.string,
|
|
210
220
|
heightInPt: _propTypes.number,
|
|
@@ -214,10 +224,12 @@ AttachmentContainer.propTypes = {
|
|
|
214
224
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
215
225
|
containerClassname: _propTypes.string,
|
|
216
226
|
customValidation: _propTypes.func,
|
|
217
|
-
disabled: _propTypes.bool,
|
|
218
227
|
disableResize: _propTypes.bool,
|
|
228
|
+
disabled: _propTypes.bool,
|
|
219
229
|
errorClassname: _propTypes.string,
|
|
230
|
+
field: _propTypes.object,
|
|
220
231
|
fieldTypes: (0, _propTypes.arrayOf)(_propTypes.string),
|
|
232
|
+
hideLabels: _propTypes.string,
|
|
221
233
|
icon: _propTypes.node,
|
|
222
234
|
input: (0, _propTypes.shape)({
|
|
223
235
|
value: (0, _propTypes.oneOfType)([_propTypes.string, (0, _propTypes.shape)({
|
|
@@ -238,7 +250,8 @@ AttachmentContainer.propTypes = {
|
|
|
238
250
|
maxWidth: _propTypes.number,
|
|
239
251
|
maxHeight: _propTypes.number
|
|
240
252
|
}),
|
|
241
|
-
sanitize: _propTypes.func
|
|
253
|
+
sanitize: _propTypes.func,
|
|
254
|
+
titleVariant: _propTypes.string
|
|
242
255
|
};
|
|
243
256
|
AttachmentContainer.defaultProps = {
|
|
244
257
|
maxFileSize: 99999999
|
|
@@ -4,43 +4,59 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _react =
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _DeleteForever = _interopRequireDefault(require("@material-ui/icons/DeleteForever"));
|
|
10
10
|
var _files = require("@widergy/web-utils/lib/constants/files");
|
|
11
11
|
var _UTFileInput = _interopRequireDefault(require("../UTFileInput"));
|
|
12
12
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
13
13
|
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
14
|
+
var _UTFieldLabel = _interopRequireDefault(require("../UTFieldLabel"));
|
|
15
|
+
var _buttonTypes = require("../../types/buttonTypes");
|
|
14
16
|
var _Preview = _interopRequireDefault(require("./components/Preview"));
|
|
15
17
|
var _constants = require("./constants");
|
|
16
18
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
19
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
+
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); }
|
|
21
|
+
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; }
|
|
18
22
|
const Attachment = _ref => {
|
|
23
|
+
var _field$configuration;
|
|
19
24
|
let {
|
|
20
25
|
acceptedFileTypes,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
loading,
|
|
26
|
+
actions,
|
|
27
|
+
classes,
|
|
24
28
|
containerClassname,
|
|
25
|
-
|
|
26
|
-
removeFileClassname,
|
|
27
|
-
onClick,
|
|
28
|
-
onChange,
|
|
29
|
+
disabled,
|
|
29
30
|
error,
|
|
31
|
+
errorClassname,
|
|
30
32
|
errorText,
|
|
33
|
+
field,
|
|
31
34
|
fieldTypes,
|
|
32
|
-
|
|
33
|
-
classes,
|
|
34
|
-
errorClassname,
|
|
35
|
+
hideLabels,
|
|
35
36
|
icon,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
loading,
|
|
38
|
+
loadingTextClassname,
|
|
39
|
+
name,
|
|
40
|
+
onChange,
|
|
41
|
+
onClick,
|
|
42
|
+
preview,
|
|
43
|
+
previewClassname,
|
|
44
|
+
previewProps,
|
|
45
|
+
removeFileClassname,
|
|
38
46
|
RemoveIcon,
|
|
39
|
-
|
|
47
|
+
titleVariant,
|
|
48
|
+
uploadingText
|
|
40
49
|
} = _ref;
|
|
50
|
+
const shouldShowUpperTitle = ((field === null || field === void 0 || (_field$configuration = field.configuration) === null || _field$configuration === void 0 ? void 0 : _field$configuration.ignore_title) || hideLabels) && (field === null || field === void 0 ? void 0 : field.title);
|
|
41
51
|
const fieldType = acceptedFileTypes || fieldTypes.map(type => _files.inputFiles[type].inputType).join();
|
|
42
52
|
const Icon = RemoveIcon || _DeleteForever.default;
|
|
43
|
-
return
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, shouldShowUpperTitle && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
54
|
+
actions: actions,
|
|
55
|
+
className: _stylesModule.default.title,
|
|
56
|
+
readOnly: field.read_only,
|
|
57
|
+
size: titleVariant,
|
|
58
|
+
required: field.required
|
|
59
|
+
}, field === null || field === void 0 ? void 0 : field.title), name && !loading ? /*#__PURE__*/_react.default.createElement("div", {
|
|
44
60
|
className: "".concat(_stylesModule.default.previewContainer, " ").concat(previewClassname)
|
|
45
61
|
}, /*#__PURE__*/_react.default.createElement(_Preview.default, {
|
|
46
62
|
preview: preview,
|
|
@@ -73,31 +89,35 @@ const Attachment = _ref => {
|
|
|
73
89
|
icon: icon,
|
|
74
90
|
disabled: disabled,
|
|
75
91
|
uploadingText: uploadingText
|
|
76
|
-
});
|
|
92
|
+
}));
|
|
77
93
|
};
|
|
78
94
|
Attachment.propTypes = {
|
|
79
95
|
acceptedFileTypes: _propTypes.string,
|
|
96
|
+
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
97
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
98
|
+
containerClassname: _propTypes.string,
|
|
99
|
+
disabled: _propTypes.bool,
|
|
100
|
+
error: _propTypes.bool,
|
|
101
|
+
errorClassname: _propTypes.string,
|
|
102
|
+
errorText: _propTypes.string,
|
|
103
|
+
field: _propTypes.object,
|
|
104
|
+
fieldTypes: (0, _propTypes.arrayOf)(_propTypes.string),
|
|
105
|
+
hideLabels: _propTypes.bool,
|
|
106
|
+
icon: _propTypes.node,
|
|
107
|
+
loading: _propTypes.bool,
|
|
108
|
+
loadingTextClassname: _propTypes.string,
|
|
80
109
|
name: _propTypes.string,
|
|
110
|
+
onChange: _propTypes.func,
|
|
111
|
+
onClick: _propTypes.func,
|
|
81
112
|
preview: (0, _propTypes.shape)({
|
|
82
113
|
src: _propTypes.string,
|
|
83
114
|
type: _propTypes.string
|
|
84
115
|
}),
|
|
85
|
-
loading: _propTypes.bool,
|
|
86
116
|
previewClassname: _propTypes.string,
|
|
87
|
-
|
|
117
|
+
previewProps: _constants.previewPropType,
|
|
88
118
|
removeFileClassname: _propTypes.string,
|
|
89
|
-
onClick: _propTypes.func,
|
|
90
|
-
onChange: _propTypes.func,
|
|
91
|
-
error: _propTypes.bool,
|
|
92
|
-
errorText: _propTypes.string,
|
|
93
|
-
fieldTypes: (0, _propTypes.arrayOf)(_propTypes.string),
|
|
94
|
-
loadingTextClassname: _propTypes.string,
|
|
95
|
-
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
96
|
-
errorClassname: _propTypes.string,
|
|
97
|
-
icon: _propTypes.node,
|
|
98
|
-
uploadingText: _propTypes.string,
|
|
99
|
-
disabled: _propTypes.bool,
|
|
100
119
|
RemoveIcon: _propTypes.elementType,
|
|
101
|
-
|
|
120
|
+
titleVariant: _propTypes.string,
|
|
121
|
+
uploadingText: _propTypes.string
|
|
102
122
|
};
|
|
103
123
|
var _default = exports.default = Attachment;
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
9
|
var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
10
|
+
var _UTTooltip = _interopRequireDefault(require("../../../UTTooltip"));
|
|
10
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
12
|
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); }
|
|
12
13
|
const ActionAdornment = _ref => {
|
|
@@ -17,13 +18,20 @@ const ActionAdornment = _ref => {
|
|
|
17
18
|
classNames
|
|
18
19
|
} = _ref;
|
|
19
20
|
if (!action) return null;
|
|
20
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
22
|
+
arrow: false,
|
|
23
|
+
tippyProps: {
|
|
24
|
+
appendTo: () => document.body,
|
|
25
|
+
interactive: false
|
|
26
|
+
},
|
|
27
|
+
content: action.tooltip
|
|
28
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
21
29
|
classNames: classNames,
|
|
22
30
|
dataTestId: dataTestId,
|
|
23
31
|
disabled: disabled,
|
|
24
32
|
size: "small",
|
|
25
33
|
variant: "text"
|
|
26
|
-
}, action), action.text);
|
|
34
|
+
}, action), action.text)));
|
|
27
35
|
};
|
|
28
36
|
ActionAdornment.propTypes = {
|
|
29
37
|
action: _propTypes.object,
|
|
@@ -154,7 +154,7 @@ const UTBreadcrumbs = _ref => {
|
|
|
154
154
|
key: "".concat(route, "-").concat(label)
|
|
155
155
|
}, !route && !menuItems || disableMenu ? /*#__PURE__*/_react.default.createElement(_UTLabel.default, _extends({
|
|
156
156
|
className: _stylesModule.default.label,
|
|
157
|
-
dataTestId: dataTestId ? "".concat(dataTestId, ".").concat(index) : "".concat(buttonId, "
|
|
157
|
+
dataTestId: dataTestId ? "".concat(dataTestId, ".").concat(index) : "".concat(buttonId, ".").concat(index),
|
|
158
158
|
variant: "small",
|
|
159
159
|
weight: "medium"
|
|
160
160
|
}, colorThemesDefinition.label), label) : /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| Name | Type | Default | Description |
|
|
10
10
|
| ----------------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
+
| actions | object | | Actions to render within `UTFieldLabel`. |
|
|
11
12
|
| classNames | objectOf(string) | | Custom class names to apply to different elements of the checklist (`root`, `header`, `checkboxesContainer`, `item`, `selectAll`). |
|
|
12
13
|
| disabled | bool | false | Disables all checkboxes in the checklist when true. |
|
|
13
14
|
| |
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
+
var _buttonTypes = require("../../../../types/buttonTypes");
|
|
9
10
|
var _utils = require("../../../UTValidation/utils");
|
|
10
11
|
var _constants = require("../../../UTCheckbox/versions/V1/constants");
|
|
11
12
|
var _UTCheckbox = _interopRequireDefault(require("../../../UTCheckbox"));
|
|
@@ -20,6 +21,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
20
21
|
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; }
|
|
21
22
|
const UTCheckList = _ref => {
|
|
22
23
|
let {
|
|
24
|
+
actions,
|
|
23
25
|
classNames = {},
|
|
24
26
|
dataTestId,
|
|
25
27
|
disabled,
|
|
@@ -93,6 +95,7 @@ const UTCheckList = _ref => {
|
|
|
93
95
|
}, (title || validationData) && /*#__PURE__*/_react.default.createElement("div", {
|
|
94
96
|
className: "".concat(_stylesModule.default.headerContainer, " ").concat(classNames.header)
|
|
95
97
|
}, title && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
98
|
+
actions: actions,
|
|
96
99
|
required: required
|
|
97
100
|
}, title), validationData && /*#__PURE__*/_react.default.createElement(_UTValidation.default, {
|
|
98
101
|
validationData: validationData
|
|
@@ -136,6 +139,7 @@ const UTCheckList = _ref => {
|
|
|
136
139
|
})));
|
|
137
140
|
};
|
|
138
141
|
UTCheckList.propTypes = {
|
|
142
|
+
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
139
143
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
140
144
|
dataTestId: _propTypes.string,
|
|
141
145
|
disabled: _propTypes.bool,
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| Name | Type | Default | Description |
|
|
10
10
|
| ------------------ | ---------------- | --------- | ------------------------------------------------------------------------------------- |
|
|
11
|
+
| actions | object | | Actions to render within `UTFieldLabel`. |
|
|
11
12
|
| checkboxDataTestId | string | | Box `data-testid`. |
|
|
12
13
|
| classNames | objectOf(string) | | Additional class names to apply for further styling. |
|
|
13
14
|
| dataTestId | string | | Whole component `data-testid`. |
|
|
@@ -20,7 +21,6 @@
|
|
|
20
21
|
| title | string | | Title to display next to the checkbox. Supports markdown when `withMarkdown` is true. |
|
|
21
22
|
| value | bool | false | Indicates if the checkbox is checked. |
|
|
22
23
|
| variant | string | 'default' | Defines the visual variant of the checkbox. |
|
|
23
|
-
| withMarkdown | bool | false | Enables markdown formatting for the `title` prop. |
|
|
24
24
|
|
|
25
25
|
## Usage
|
|
26
26
|
|
|
@@ -11,6 +11,7 @@ var _UTFieldLabel = _interopRequireDefault(require("../../../UTFieldLabel"));
|
|
|
11
11
|
var _UTIcon = _interopRequireDefault(require("../../../UTIcon"));
|
|
12
12
|
var _WithTheme = _interopRequireDefault(require("../../../WithTheme"));
|
|
13
13
|
var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../../../UTTouchableWithoutFeedback"));
|
|
14
|
+
var _buttonTypes = require("../../../../types/buttonTypes");
|
|
14
15
|
var _constants = require("./constants");
|
|
15
16
|
var _theme = require("./theme");
|
|
16
17
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
@@ -20,6 +21,7 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
20
21
|
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); }
|
|
21
22
|
const UTCheckbox = _ref => {
|
|
22
23
|
let {
|
|
24
|
+
actions,
|
|
23
25
|
checkboxDataTestId,
|
|
24
26
|
classes: theme,
|
|
25
27
|
classNames,
|
|
@@ -32,7 +34,7 @@ const UTCheckbox = _ref => {
|
|
|
32
34
|
title,
|
|
33
35
|
value = false,
|
|
34
36
|
variant = 'default',
|
|
35
|
-
|
|
37
|
+
withUpperTitle
|
|
36
38
|
} = _ref;
|
|
37
39
|
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(theme, classNames), [classNames, theme]);
|
|
38
40
|
const iconName = (0, _react.useMemo)(() => indeterminate ? _constants.INDETERMINATE_ICON : value === true ? _constants.CHECKED_ICON : '', [indeterminate, value]);
|
|
@@ -48,7 +50,10 @@ const UTCheckbox = _ref => {
|
|
|
48
50
|
const BoxContainerComponent = variant === _constants.BUTTON_VARIANT ? 'div' : _UTTouchableWithoutFeedback.default;
|
|
49
51
|
const rootComponentProps = variant === _constants.BUTTON_VARIANT ? touchableProps : {};
|
|
50
52
|
const boxContainerProps = variant === _constants.BUTTON_VARIANT ? {} : touchableProps;
|
|
51
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, withUpperTitle && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
54
|
+
actions: actions,
|
|
55
|
+
required: required
|
|
56
|
+
}, title), /*#__PURE__*/_react.default.createElement(RootComponent, _extends({
|
|
52
57
|
dataTestId: dataTestId,
|
|
53
58
|
className: classes.container
|
|
54
59
|
}, rootComponentProps), /*#__PURE__*/_react.default.createElement(BoxContainerComponent, _extends({
|
|
@@ -69,12 +74,12 @@ const UTCheckbox = _ref => {
|
|
|
69
74
|
size: 16
|
|
70
75
|
})))), /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
71
76
|
className: classes.title,
|
|
72
|
-
|
|
73
|
-
required: required
|
|
74
|
-
|
|
75
|
-
}, title));
|
|
77
|
+
highlighted: shouldHighlightLabel,
|
|
78
|
+
required: required
|
|
79
|
+
}, title)));
|
|
76
80
|
};
|
|
77
81
|
UTCheckbox.propTypes = {
|
|
82
|
+
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
78
83
|
checkboxDataTestId: _propTypes.string,
|
|
79
84
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
80
85
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
@@ -92,6 +97,6 @@ UTCheckbox.propTypes = {
|
|
|
92
97
|
title: _propTypes.string,
|
|
93
98
|
value: _propTypes.bool,
|
|
94
99
|
variant: _propTypes.string,
|
|
95
|
-
|
|
100
|
+
withUpperTitle: _propTypes.bool
|
|
96
101
|
};
|
|
97
102
|
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTCheckbox);
|
|
@@ -13,9 +13,11 @@ var _es = _interopRequireDefault(require("dayjs/locale/es"));
|
|
|
13
13
|
var _customParseFormat = _interopRequireDefault(require("dayjs/plugin/customParseFormat"));
|
|
14
14
|
var _form = require("@widergy/web-utils/lib/form");
|
|
15
15
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
16
|
+
var _UTFieldLabel = _interopRequireDefault(require("../UTFieldLabel"));
|
|
16
17
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
17
|
-
var
|
|
18
|
+
var _buttonTypes = require("../../types/buttonTypes");
|
|
18
19
|
var _formTypes = require("../../types/formTypes");
|
|
20
|
+
var _classesUtils = require("../../utils/classesUtils");
|
|
19
21
|
var _Day = _interopRequireDefault(require("./components/Day"));
|
|
20
22
|
var _theme = require("./theme");
|
|
21
23
|
var _types = require("./types");
|
|
@@ -54,8 +56,9 @@ class CustomUtils extends _dayjs.default {
|
|
|
54
56
|
}
|
|
55
57
|
}
|
|
56
58
|
const UTDatePicker = _ref => {
|
|
57
|
-
var _field$configuration, _field$configuration2;
|
|
59
|
+
var _field$configuration, _field$configuration2, _field$configuration3;
|
|
58
60
|
let {
|
|
61
|
+
actions,
|
|
59
62
|
classes: themeClasses,
|
|
60
63
|
classNames,
|
|
61
64
|
CustomIcon,
|
|
@@ -75,22 +78,29 @@ const UTDatePicker = _ref => {
|
|
|
75
78
|
placeholder,
|
|
76
79
|
popoverProps,
|
|
77
80
|
range,
|
|
81
|
+
titleVariant,
|
|
78
82
|
variant,
|
|
79
83
|
withUpperTitle
|
|
80
84
|
} = _ref;
|
|
81
85
|
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
82
86
|
const configMask = (field === null || field === void 0 || (_field$configuration = field.configuration) === null || _field$configuration === void 0 ? void 0 : _field$configuration.date_mask) || _constants.OUTPUT_LABEL_MASK;
|
|
83
87
|
const onlyPastMonth = ((_field$configuration2 = field.configuration) === null || _field$configuration2 === void 0 || (_field$configuration2 = _field$configuration2.customDateValidations) === null || _field$configuration2 === void 0 || (_field$configuration2 = _field$configuration2.onlyPastMonth) === null || _field$configuration2 === void 0 ? void 0 : _field$configuration2.active) || false;
|
|
88
|
+
const avoidFutureDates = ((_field$configuration3 = field.configuration) === null || _field$configuration3 === void 0 || (_field$configuration3 = _field$configuration3.customDateValidations) === null || _field$configuration3 === void 0 || (_field$configuration3 = _field$configuration3.avoidFutureDates) === null || _field$configuration3 === void 0 ? void 0 : _field$configuration3.active) || false;
|
|
84
89
|
const {
|
|
85
|
-
minDate
|
|
86
|
-
maxDate
|
|
87
|
-
} = (onlyPastMonth ? (0, _utils.getPastMonthDates)() : range) || {};
|
|
90
|
+
minDate,
|
|
91
|
+
maxDate
|
|
92
|
+
} = (onlyPastMonth ? (0, _utils.getPastMonthDates)() : avoidFutureDates ? (0, _utils.getMaxDate)() : range) || {};
|
|
88
93
|
const [pickedDate, setPickedDate] = (0, _react.useState)(null);
|
|
89
94
|
const [internalError, setInternalError] = (0, _react.useState)(null);
|
|
90
95
|
const handleChange = date => {
|
|
91
96
|
setPickedDate(date);
|
|
92
97
|
const newValue = (0, _dayjs2.default)(date, _constants.OUTPUT_LABEL_MASK, true);
|
|
93
|
-
if (
|
|
98
|
+
if ((0, _utils.isValidDate)({
|
|
99
|
+
avoidFutureDates,
|
|
100
|
+
newValue,
|
|
101
|
+
onlyPastMonth,
|
|
102
|
+
range
|
|
103
|
+
})) input.onChange(newValue.format(configMask));else input.onChange('');
|
|
94
104
|
};
|
|
95
105
|
(0, _react.useEffect)(() => {
|
|
96
106
|
if (!input.value && pickedDate !== null && pickedDate !== void 0 && pickedDate.isValid()) setPickedDate(null);else if ((0, _utils.dateMatchesFormat)(input.value, configMask)) setPickedDate((0, _dayjs2.default)(input.value, configMask));
|
|
@@ -107,8 +117,12 @@ const UTDatePicker = _ref => {
|
|
|
107
117
|
const OpenerIcon = CustomIcon || CalendarIcon;
|
|
108
118
|
const operenerIconReference = (0, _react.useRef)();
|
|
109
119
|
const errorMessage = (0, _form.shouldShowErrors)(meta) && (internalError || meta.error) || '';
|
|
110
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, withUpperTitle && /*#__PURE__*/_react.default.createElement(
|
|
120
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, withUpperTitle && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
121
|
+
actions: actions,
|
|
111
122
|
className: classes.upperTitle,
|
|
123
|
+
readOnly: field.read_only,
|
|
124
|
+
required: field.required,
|
|
125
|
+
size: titleVariant,
|
|
112
126
|
withMarkdown: true
|
|
113
127
|
}, field.title), /*#__PURE__*/_react.default.createElement(_pickers.MuiPickersUtilsProvider, {
|
|
114
128
|
utils: disableToolbar ? _dayjs.default : CustomUtils,
|
|
@@ -159,12 +173,13 @@ const UTDatePicker = _ref => {
|
|
|
159
173
|
}, pickerProps))));
|
|
160
174
|
};
|
|
161
175
|
UTDatePicker.propTypes = {
|
|
162
|
-
|
|
176
|
+
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
163
177
|
classNames: _types.classesPropTypes,
|
|
178
|
+
classes: _types.classesPropTypes,
|
|
164
179
|
CustomIcon: _propTypes.node,
|
|
165
180
|
dayFormat: _propTypes.string,
|
|
166
|
-
disabled: _propTypes.bool,
|
|
167
181
|
disableToolbar: _propTypes.bool,
|
|
182
|
+
disabled: _propTypes.bool,
|
|
168
183
|
field: _formTypes.fieldType,
|
|
169
184
|
iconAnchor: _propTypes.bool,
|
|
170
185
|
input: _formTypes.inputPropTypes.isRequired,
|
|
@@ -173,6 +188,7 @@ UTDatePicker.propTypes = {
|
|
|
173
188
|
inputVariant: _propTypes.string,
|
|
174
189
|
invalidDateMessage: _propTypes.string,
|
|
175
190
|
maxDateMessage: _propTypes.string,
|
|
191
|
+
meta: _formTypes.metaPropTypes,
|
|
176
192
|
minDateMessage: _propTypes.string,
|
|
177
193
|
pickerProps: _propTypes.object,
|
|
178
194
|
placeholder: _propTypes.string,
|
|
@@ -181,7 +197,7 @@ UTDatePicker.propTypes = {
|
|
|
181
197
|
maxDate: _propTypes.string,
|
|
182
198
|
minDate: _propTypes.string
|
|
183
199
|
}),
|
|
184
|
-
|
|
200
|
+
titleVariant: _propTypes.string,
|
|
185
201
|
variant: _propTypes.string,
|
|
186
202
|
withUpperTitle: _propTypes.bool
|
|
187
203
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.isSelected = exports.getPastMonthDates = exports.dateMatchesFormat = void 0;
|
|
6
|
+
exports.isValidDate = exports.isSelected = exports.getPastMonthDates = exports.getMaxDate = exports.dateMatchesFormat = void 0;
|
|
7
7
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
8
8
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
const isSelected = (date, selectedDate) => selectedDate && date.isSame(selectedDate, 'day');
|
|
@@ -19,4 +19,32 @@ const getPastMonthDates = () => {
|
|
|
19
19
|
maxDate: new Date(currentYear, currentMonth, 0)
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
|
-
exports.getPastMonthDates = getPastMonthDates;
|
|
22
|
+
exports.getPastMonthDates = getPastMonthDates;
|
|
23
|
+
const getMaxDate = () => {
|
|
24
|
+
const currentDate = new Date();
|
|
25
|
+
return {
|
|
26
|
+
maxDate: currentDate
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.getMaxDate = getMaxDate;
|
|
30
|
+
const avoidFutureDatesValidation = date => !(0, _dayjs.default)().isBefore(date);
|
|
31
|
+
const rangeValidation = (date, range) => {
|
|
32
|
+
const {
|
|
33
|
+
minDate,
|
|
34
|
+
maxDate
|
|
35
|
+
} = range;
|
|
36
|
+
return date.isBetween(minDate, maxDate, null, '[]');
|
|
37
|
+
};
|
|
38
|
+
const isValidDate = _ref => {
|
|
39
|
+
let {
|
|
40
|
+
avoidFutureDates,
|
|
41
|
+
newValue,
|
|
42
|
+
onlyPastMonth,
|
|
43
|
+
range
|
|
44
|
+
} = _ref;
|
|
45
|
+
if (avoidFutureDates && !avoidFutureDatesValidation(newValue)) return false;
|
|
46
|
+
if (onlyPastMonth && !rangeValidation(newValue, getPastMonthDates())) return false;
|
|
47
|
+
if (range && !rangeValidation(newValue, range)) return false;
|
|
48
|
+
return newValue.isValid();
|
|
49
|
+
};
|
|
50
|
+
exports.isValidDate = isValidDate;
|
|
@@ -5,41 +5,65 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
9
|
+
var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
|
8
10
|
var _propTypes = require("prop-types");
|
|
9
11
|
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
12
|
+
var _UTButton = _interopRequireDefault(require("../UTButton"));
|
|
13
|
+
var _UTTooltip = _interopRequireDefault(require("../UTTooltip"));
|
|
14
|
+
var _inputs = require("../../constants/inputs");
|
|
10
15
|
var _constants = require("./constants");
|
|
11
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
12
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
18
|
const UTFieldLabel = _ref => {
|
|
14
19
|
let {
|
|
20
|
+
actions,
|
|
15
21
|
children,
|
|
16
|
-
|
|
22
|
+
className,
|
|
17
23
|
dataTestId,
|
|
24
|
+
highlighted,
|
|
25
|
+
readOnly,
|
|
18
26
|
required,
|
|
19
|
-
|
|
20
|
-
variant,
|
|
27
|
+
size = 'large',
|
|
21
28
|
weight
|
|
22
29
|
} = _ref;
|
|
23
30
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
31
|
+
className: "".concat(!(0, _isEmpty.default)(actions) ? _stylesModule.default.labelWithActions : '')
|
|
32
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
24
33
|
className: "".concat(_stylesModule.default.label, " ").concat(className)
|
|
25
34
|
}, /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
26
|
-
colorTheme:
|
|
35
|
+
colorTheme: readOnly ? 'gray' : highlighted ? 'accent' : 'dark',
|
|
27
36
|
dataTestId: dataTestId,
|
|
28
|
-
variant:
|
|
37
|
+
variant: _inputs.TITLE_VARIANTS[size],
|
|
29
38
|
withMarkdown: true
|
|
30
39
|
}, children), required && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
31
40
|
colorTheme: "error",
|
|
32
41
|
shade: "04",
|
|
33
|
-
variant:
|
|
42
|
+
variant: _inputs.TITLE_VARIANTS[size],
|
|
34
43
|
weight: weight
|
|
35
|
-
}, _constants.REQUIRED_LABEL))
|
|
44
|
+
}, _constants.REQUIRED_LABEL)), !(0, _isEmpty.default)(actions) && (0, _isArray.default)(actions) && /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
+
className: _stylesModule.default.actionsContainer
|
|
46
|
+
}, actions.map(action => {
|
|
47
|
+
var _action$title;
|
|
48
|
+
return /*#__PURE__*/_react.default.createElement(_UTTooltip.default, {
|
|
49
|
+
arrow: false,
|
|
50
|
+
key: "".concat((_action$title = action.title) !== null && _action$title !== void 0 ? _action$title : action.Icon),
|
|
51
|
+
tippyProps: {
|
|
52
|
+
appendTo: () => document.body,
|
|
53
|
+
interactive: false
|
|
54
|
+
},
|
|
55
|
+
content: action.tooltip
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTButton.default, action, action.title)));
|
|
57
|
+
})));
|
|
36
58
|
};
|
|
37
59
|
UTFieldLabel.propTypes = {
|
|
60
|
+
actions: (0, _propTypes.arrayOf)(_propTypes.object),
|
|
38
61
|
className: _propTypes.string,
|
|
39
|
-
colorTheme: _propTypes.string,
|
|
40
62
|
dataTestId: _propTypes.string,
|
|
63
|
+
highlighted: _propTypes.bool,
|
|
64
|
+
readOnly: _propTypes.bool,
|
|
41
65
|
required: _propTypes.bool,
|
|
42
|
-
|
|
66
|
+
size: _propTypes.string,
|
|
43
67
|
weight: _propTypes.string
|
|
44
68
|
};
|
|
45
69
|
var _default = exports.default = UTFieldLabel;
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
.labelWithActions {
|
|
2
|
+
align-items: center;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
gap: 8px;
|
|
6
|
+
justify-content: space-between;
|
|
7
|
+
width: 100%
|
|
8
|
+
}
|
|
9
|
+
|
|
1
10
|
.label {
|
|
2
11
|
display: flex;
|
|
3
12
|
flex-direction: row;
|
|
4
13
|
grid-gap: 4px;
|
|
5
14
|
}
|
|
15
|
+
|
|
16
|
+
.actionsContainer {
|
|
17
|
+
display: flex;
|
|
18
|
+
gap: 8px;
|
|
19
|
+
}
|
|
@@ -78,7 +78,7 @@ class UTFileInput extends _react.PureComponent {
|
|
|
78
78
|
}, uploadingText), /*#__PURE__*/_react.default.createElement("div", {
|
|
79
79
|
className: _stylesModule.default.loading
|
|
80
80
|
})) : /*#__PURE__*/_react.default.createElement("div", {
|
|
81
|
-
className: _stylesModule.default.insideContainer
|
|
81
|
+
className: "".concat(_stylesModule.default.insideContainer, " ").concat(disabled ? _stylesModule.default.disabled : '')
|
|
82
82
|
}, Icon || /*#__PURE__*/_react.default.createElement(UploadImage, {
|
|
83
83
|
className: "".concat(_stylesModule.default.icon, " ").concat(classes.icon)
|
|
84
84
|
}), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M8 9H16" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
3
|
+
<path d="M8 13H14" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
4
|
+
<path d="M13 20L12 21L9 18H6C5.20435 18 4.44129 17.6839 3.87868 17.1213C3.31607 16.5587 3 15.7956 3 15V7C3 6.20435 3.31607 5.44129 3.87868 4.87868C4.44129 4.31607 5.20435 4 6 4H18C18.7956 4 19.5587 4.31607 20.1213 4.87868C20.6839 5.44129 21 6.20435 21 7V12.5" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
5
|
+
<path d="M18.9293 15.522C19.0963 15.3549 19.2946 15.2224 19.5129 15.132C19.7311 15.0416 19.965 14.9951 20.2012 14.9951C20.4374 14.9951 20.6713 15.0416 20.8896 15.132C21.1078 15.2224 21.3061 15.3549 21.4731 15.522C21.6402 15.689 21.7727 15.8873 21.8631 16.1055C21.9535 16.3238 22 16.5577 22 16.7939C22 17.0301 21.9535 17.264 21.8631 17.4823C21.7727 17.7005 21.6402 17.8988 21.4731 18.0658L18.5696 20.9951H16V18.4256L18.9293 15.522Z" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
|
|
6
|
+
</svg>
|
|
@@ -140,6 +140,33 @@ EnergyIconHome.defaultProps = {
|
|
|
140
140
|
stroke: "currentColor",
|
|
141
141
|
xmlns: "http://www.w3.org/2000/svg"
|
|
142
142
|
};
|
|
143
|
+
var EnergyIconMessageEdit = function EnergyIconMessageEdit(props) {
|
|
144
|
+
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
145
|
+
d: "M8 9h8M8 13h6M13 20l-1 1-3-3H6a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3v5.5M18.93 15.522a1.797 1.797 0 0 1 2.933.583 1.8 1.8 0 0 1-.39 1.96l-2.903 2.93H16v-2.57l2.93-2.903Z"
|
|
146
|
+
}));
|
|
147
|
+
};
|
|
148
|
+
EnergyIconMessageEdit.defaultProps = {
|
|
149
|
+
width: "24",
|
|
150
|
+
height: "24",
|
|
151
|
+
viewBox: "0 0 24 24",
|
|
152
|
+
fill: "none",
|
|
153
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
154
|
+
};
|
|
155
|
+
var EnergyIconQuestionFilled = function EnergyIconQuestionFilled(props) {
|
|
156
|
+
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
157
|
+
fill: "currentColor",
|
|
158
|
+
fillRule: "evenodd",
|
|
159
|
+
clipRule: "evenodd",
|
|
160
|
+
d: "M10 2.287a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-10 8c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10-10-4.477-10-10Zm8.475-5.655a3.6 3.6 0 1 1 2.857 6.598.5.5 0 0 0-.334.5 1 1 0 0 1-1.996.114 2.5 2.5 0 0 1 1.65-2.495 1.6 1.6 0 1 0-1.855-2.458 1 1 0 0 1-1.594-1.208 3.6 3.6 0 0 1 1.272-1.051ZM10 14.287a1 1 0 0 1 1 1v.01a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1Z"
|
|
161
|
+
}));
|
|
162
|
+
};
|
|
163
|
+
EnergyIconQuestionFilled.defaultProps = {
|
|
164
|
+
width: "20",
|
|
165
|
+
height: "21",
|
|
166
|
+
viewBox: "0 0 20 21",
|
|
167
|
+
fill: "none",
|
|
168
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
169
|
+
};
|
|
143
170
|
var EnergyIconSendFilled = function EnergyIconSendFilled(props) {
|
|
144
171
|
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
145
172
|
d: "M20.816 10.742 3.93 2.504a1.086 1.086 0 0 0-.524-.106 1.11 1.11 0 0 0-.508.16c-.152.098-.277.231-.367.387-.086.16-.133.336-.133.52v.027c0 .145.02.285.055.426l1.617 6.48c.024.086.07.165.137.223.07.055.152.094.242.102l7.117.793c.118.015.227.07.309.16a.49.49 0 0 1-.309.808l-7.117.793a.438.438 0 0 0-.379.325l-1.617 6.48a1.712 1.712 0 0 0-.055.422v.031c0 .18.047.36.137.516.086.16.211.293.363.387.157.097.329.152.508.16.184.011.364-.028.524-.106l16.886-8.238c.235-.113.434-.293.57-.516a1.378 1.378 0 0 0 0-1.48 1.426 1.426 0 0 0-.57-.516Zm0 0",
|
|
@@ -179,21 +206,6 @@ EnergyIconTruck.defaultProps = {
|
|
|
179
206
|
stroke: "currentColor",
|
|
180
207
|
xmlns: "http://www.w3.org/2000/svg"
|
|
181
208
|
};
|
|
182
|
-
var EnergyIconQuestionFilled = function EnergyIconQuestionFilled(props) {
|
|
183
|
-
return /*#__PURE__*/_react.default.createElement("svg", props, /*#__PURE__*/_react.default.createElement("path", {
|
|
184
|
-
fill: "currentColor",
|
|
185
|
-
fillRule: "evenodd",
|
|
186
|
-
clipRule: "evenodd",
|
|
187
|
-
d: "M10 2.287a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-10 8c0-5.523 4.477-10 10-10s10 4.477 10 10-4.477 10-10 10-10-4.477-10-10Zm8.475-5.655a3.6 3.6 0 1 1 2.857 6.598.5.5 0 0 0-.334.5 1 1 0 0 1-1.996.114 2.5 2.5 0 0 1 1.65-2.495 1.6 1.6 0 1 0-1.855-2.458 1 1 0 0 1-1.594-1.208 3.6 3.6 0 0 1 1.272-1.051ZM10 14.287a1 1 0 0 1 1 1v.01a1 1 0 1 1-2 0v-.01a1 1 0 0 1 1-1Z"
|
|
188
|
-
}));
|
|
189
|
-
};
|
|
190
|
-
EnergyIconQuestionFilled.defaultProps = {
|
|
191
|
-
width: "20",
|
|
192
|
-
height: "21",
|
|
193
|
-
viewBox: "0 0 20 21",
|
|
194
|
-
fill: "none",
|
|
195
|
-
xmlns: "http://www.w3.org/2000/svg"
|
|
196
|
-
};
|
|
197
209
|
const FILLED_ICON_COLOR = exports.FILLED_ICON_COLOR = 'transparent';
|
|
198
210
|
const DEFAULT_INTERNAL_SHADE = exports.DEFAULT_INTERNAL_SHADE = _Palette.COLOR_SHADES.shade02;
|
|
199
211
|
const DEFAULT_COLOR_THEME = exports.DEFAULT_COLOR_THEME = _Palette.COLOR_THEMES.dark;
|
|
@@ -208,7 +220,8 @@ const ENERGY_ICONS = exports.ENERGY_ICONS = {
|
|
|
208
220
|
EnergyIconCart,
|
|
209
221
|
EnergyIconConsumption,
|
|
210
222
|
EnergyIconHome,
|
|
223
|
+
EnergyIconMessageEdit,
|
|
224
|
+
EnergyIconQuestionFilled,
|
|
211
225
|
EnergyIconSendFilled,
|
|
212
|
-
EnergyIconTruck
|
|
213
|
-
EnergyIconQuestionFilled
|
|
226
|
+
EnergyIconTruck
|
|
214
227
|
};
|
|
@@ -114,7 +114,7 @@ const UTMenu = _ref => {
|
|
|
114
114
|
className: classes.scrollBar
|
|
115
115
|
}, scrollBarProps), items === null || items === void 0 ? void 0 : items.map((item, index) => {
|
|
116
116
|
const handleClick = event => {
|
|
117
|
-
if (item.onClick) item.onClick(event, contextData);else if (onClickItem) onClickItem(event, contextData);
|
|
117
|
+
if (item.onClick) item.onClick(event, contextData, onClose);else if (onClickItem) onClickItem(event, contextData);
|
|
118
118
|
if (contextData.clickCallback) contextData.clickCallback();
|
|
119
119
|
};
|
|
120
120
|
return ItemComponent ? withMenuItem ? /*#__PURE__*/_react.default.createElement(_MenuItem.default, _extends({
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SIZES = exports.ACCEPT_BUTTON_TEXT = void 0;
|
|
6
|
+
exports.SIZES = exports.MENU_LABEL = exports.ACCEPT_BUTTON_TEXT = void 0;
|
|
7
7
|
const SIZES = exports.SIZES = {
|
|
8
8
|
L: 'large',
|
|
9
9
|
M: 'medium'
|
|
10
10
|
};
|
|
11
|
-
const ACCEPT_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = 'Aceptar';
|
|
11
|
+
const ACCEPT_BUTTON_TEXT = exports.ACCEPT_BUTTON_TEXT = 'Aceptar';
|
|
12
|
+
const MENU_LABEL = exports.MENU_LABEL = 'Más';
|
|
@@ -9,9 +9,11 @@ var _SwipeableDrawer = _interopRequireDefault(require("@material-ui/core/Swipeab
|
|
|
9
9
|
require("react-perfect-scrollbar/dist/css/styles.css");
|
|
10
10
|
var _reactPerfectScrollbar = _interopRequireDefault(require("react-perfect-scrollbar"));
|
|
11
11
|
var _propTypes = require("prop-types");
|
|
12
|
+
var _isArray = _interopRequireDefault(require("lodash/isArray"));
|
|
12
13
|
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
13
14
|
var _UTButton = _interopRequireDefault(require("../../../UTButton"));
|
|
14
15
|
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
16
|
+
var _UTMenu = _interopRequireDefault(require("../../../UTMenu"));
|
|
15
17
|
var _index = _interopRequireDefault(require("../../../UTProgressBar/index.js"));
|
|
16
18
|
var _classesUtils = require("../../../../utils/classesUtils.js");
|
|
17
19
|
var _index2 = _interopRequireDefault(require("../../../WithTheme/index.js"));
|
|
@@ -57,6 +59,10 @@ const UTPanel = _ref => {
|
|
|
57
59
|
} = _ref;
|
|
58
60
|
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(theme, classNames), [classNames, theme]);
|
|
59
61
|
const [collapseHeader, setCollapseHeader] = (0, _react.useState)(true);
|
|
62
|
+
const [anchor, setAnchor] = (0, _react.useState)();
|
|
63
|
+
const openMenu = event => setAnchor(event.currentTarget);
|
|
64
|
+
const closeMenu = () => setAnchor();
|
|
65
|
+
const secondaryActionAsMenu = (0, _isArray.default)(headerSecondaryActionButton);
|
|
60
66
|
const {
|
|
61
67
|
closeButton: closeButtonClass,
|
|
62
68
|
headerContainer: headerContainerClass,
|
|
@@ -122,10 +128,19 @@ const UTPanel = _ref => {
|
|
|
122
128
|
colorTheme: "gray"
|
|
123
129
|
}, subtitle))), /*#__PURE__*/_react.default.createElement("div", {
|
|
124
130
|
className: _stylesModule.default.headerRightArea
|
|
125
|
-
}, !(0, _isEmpty.default)(headerSecondaryActionButton) && /*#__PURE__*/_react.default.createElement(
|
|
131
|
+
}, !(0, _isEmpty.default)(headerSecondaryActionButton) && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, secondaryActionAsMenu && /*#__PURE__*/_react.default.createElement(_UTMenu.default, {
|
|
132
|
+
anchor: anchor,
|
|
133
|
+
iconBefore: true,
|
|
134
|
+
ItemComponent: _UTButton.default,
|
|
135
|
+
items: headerSecondaryActionButton,
|
|
136
|
+
menuPlacement: "bottom-end",
|
|
137
|
+
onClose: closeMenu,
|
|
138
|
+
withMenuItem: true
|
|
139
|
+
}), /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
126
140
|
colorTheme: "primary",
|
|
141
|
+
onClick: secondaryActionAsMenu ? openMenu : undefined,
|
|
127
142
|
variant: "semitransparent"
|
|
128
|
-
}, headerSecondaryActionButton), headerSecondaryActionButton.text), !(0, _isEmpty.default)(headerMainActionButton) && /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
143
|
+
}, !secondaryActionAsMenu && headerSecondaryActionButton), secondaryActionAsMenu ? _constants.MENU_LABEL : headerSecondaryActionButton.text)), !(0, _isEmpty.default)(headerMainActionButton) && /*#__PURE__*/_react.default.createElement(_UTButton.default, _extends({
|
|
129
144
|
colorTheme: "success",
|
|
130
145
|
variant: "filled"
|
|
131
146
|
}, headerMainActionButton), headerMainActionButton.text)))), !(0, _isEmpty.default)(headerItems) && /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
| Name | Type | Default | Description |
|
|
10
10
|
| --------------------- | ------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
|
|
11
|
+
| actions | object | | Actions to render within `UTFieldLabel`. |
|
|
11
12
|
| areaCodeDataTestId | string | | Identifier for the area code input field, useful for testing. |
|
|
12
13
|
| areaCodePlaceholder | string | | Placeholder for the area code input field. |
|
|
13
14
|
| countryCode | string | | Prefix for the phone number, typically used to display the country code (e.g., "+1" for the US). |
|
|
@@ -6,13 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _propTypes = require("prop-types");
|
|
9
|
-
var _constants = require("../../../UTBaseInputField/constants");
|
|
10
|
-
var _utils = require("../../../UTValidation/utils");
|
|
11
|
-
var _inputs = require("../../../../constants/inputs");
|
|
12
9
|
var _UTBaseInputField = _interopRequireDefault(require("../../../UTBaseInputField"));
|
|
13
10
|
var _UTFieldLabel = _interopRequireDefault(require("../../../UTFieldLabel"));
|
|
14
11
|
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
15
12
|
var _UTValidation = _interopRequireWildcard(require("../../../UTValidation"));
|
|
13
|
+
var _buttonTypes = require("../../../../types/buttonTypes");
|
|
14
|
+
var _constants = require("../../../UTBaseInputField/constants");
|
|
15
|
+
var _utils = require("../../../UTValidation/utils");
|
|
16
16
|
var _constants2 = require("./constants");
|
|
17
17
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
18
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -20,6 +20,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
20
20
|
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; }
|
|
21
21
|
const UTPhoneInput = _ref => {
|
|
22
22
|
let {
|
|
23
|
+
actions,
|
|
23
24
|
areaCodeDataTestId,
|
|
24
25
|
areaCodePlaceholder,
|
|
25
26
|
countryCode,
|
|
@@ -110,15 +111,15 @@ const UTPhoneInput = _ref => {
|
|
|
110
111
|
}, [areaCodeState.code, phoneNumber, withAreaCode, onChange, value]);
|
|
111
112
|
const validationData = validations || areaCodeState.error && (0, _utils.formatErrorToValidation)(areaCodeState.error) || error && (0, _utils.formatErrorToValidation)(error);
|
|
112
113
|
const hasError = (validationData === null || validationData === void 0 ? void 0 : validationData.length) > 0;
|
|
113
|
-
const titleColorTheme = readOnly ? 'gray' : 'dark';
|
|
114
114
|
const getAreaCodeMaxLength = () => Math.min(maxLength - phoneNumber.length, 4);
|
|
115
115
|
const getPhoneNumberMaxLength = () => withAreaCode ? Math.min(maxLength - areaCodeState.code.length, maxLength - 2) : maxLength;
|
|
116
116
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
117
117
|
className: _stylesModule.default.container
|
|
118
118
|
}, title && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
119
|
-
|
|
119
|
+
actions: actions,
|
|
120
|
+
readOnly: readOnly,
|
|
120
121
|
required: required,
|
|
121
|
-
|
|
122
|
+
size: titleVariant
|
|
122
123
|
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
123
124
|
className: _stylesModule.default.inputsContainer
|
|
124
125
|
}, withAreaCode && /*#__PURE__*/_react.default.createElement(_UTBaseInputField.default, {
|
|
@@ -177,6 +178,7 @@ const UTPhoneInput = _ref => {
|
|
|
177
178
|
}));
|
|
178
179
|
};
|
|
179
180
|
UTPhoneInput.propTypes = {
|
|
181
|
+
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
180
182
|
areaCodeDataTestId: _propTypes.string,
|
|
181
183
|
areaCodePlaceholder: _propTypes.string,
|
|
182
184
|
countryCode: _propTypes.string,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# UTPopper
|
|
2
|
+
|
|
3
|
+
## Description
|
|
4
|
+
|
|
5
|
+
Component meant to be used as a PopUp anchored to other elements
|
|
6
|
+
|
|
7
|
+
## Props
|
|
8
|
+
|
|
9
|
+
| Name | Type | Default | Description |
|
|
10
|
+
| ----------------------- | ---------------------------------- | ------- | ------------------------------------------------- |
|
|
11
|
+
| anchor | oneOfType([refType, elementType]), | | Element to which the popper is anchored |
|
|
12
|
+
| children, | object | | Elements to render within the popper |
|
|
13
|
+
| classes, | objectOf( string) | | CSS classes |
|
|
14
|
+
| clickAwayListenerProps, | object | | Props handed over to ClickawayListener |
|
|
15
|
+
| onClose, | func | | Close function |
|
|
16
|
+
| paperProps, | object | | Props to hand over to the UTPapper |
|
|
17
|
+
| ...popperProps | object | | Spread of props compatible with materialUIs props |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _core = require("@material-ui/core");
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
11
|
+
var _commonTypes = require("../../types/commonTypes");
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
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
|
+
const UTPopper = _ref => {
|
|
17
|
+
let {
|
|
18
|
+
anchor,
|
|
19
|
+
children,
|
|
20
|
+
classes,
|
|
21
|
+
clickAwayListenerProps,
|
|
22
|
+
onClose,
|
|
23
|
+
paperProps,
|
|
24
|
+
...popperProps
|
|
25
|
+
} = _ref;
|
|
26
|
+
const [open, handleOpenState] = (0, _react.useState)(false);
|
|
27
|
+
(0, _react.useEffect)(() => {
|
|
28
|
+
const shouldOpen = !!anchor && !(0, _isEmpty.default)(children);
|
|
29
|
+
handleOpenState(shouldOpen);
|
|
30
|
+
}, [anchor, children]);
|
|
31
|
+
return anchor ? /*#__PURE__*/_react.default.createElement(_core.ClickAwayListener, _extends({
|
|
32
|
+
onClickAway: onClose
|
|
33
|
+
}, clickAwayListenerProps), /*#__PURE__*/_react.default.createElement(_core.Popper, _extends({
|
|
34
|
+
anchorEl: anchor,
|
|
35
|
+
open: open,
|
|
36
|
+
transition: true
|
|
37
|
+
}, popperProps), /*#__PURE__*/_react.default.createElement(_core.Paper, _extends({
|
|
38
|
+
className: classes === null || classes === void 0 ? void 0 : classes.paper
|
|
39
|
+
}, paperProps), children))) : null;
|
|
40
|
+
};
|
|
41
|
+
UTPopper.propTypes = {
|
|
42
|
+
anchor: (0, _propTypes.oneOfType)([_commonTypes.refType, _propTypes.elementType]),
|
|
43
|
+
children: _propTypes.object,
|
|
44
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
45
|
+
clickAwayListenerProps: _propTypes.object,
|
|
46
|
+
onClose: _propTypes.func,
|
|
47
|
+
paperProps: _propTypes.object,
|
|
48
|
+
popperProps: _propTypes.object
|
|
49
|
+
};
|
|
50
|
+
var _default = exports.default = UTPopper;
|
|
@@ -9,9 +9,10 @@ var _FormControlLabel = _interopRequireDefault(require("@material-ui/core/FormCo
|
|
|
9
9
|
var _Radio = _interopRequireDefault(require("@material-ui/core/Radio"));
|
|
10
10
|
var _RadioGroup = _interopRequireDefault(require("@material-ui/core/RadioGroup"));
|
|
11
11
|
var _propTypes = require("prop-types");
|
|
12
|
+
var _buttonTypes = require("../../types/buttonTypes");
|
|
12
13
|
var _formTypes = require("../../types/formTypes");
|
|
13
14
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
14
|
-
var
|
|
15
|
+
var _UTFieldLabel = _interopRequireDefault(require("../UTFieldLabel"));
|
|
15
16
|
var _classesUtils = require("../../utils/classesUtils");
|
|
16
17
|
var _theme = require("./theme");
|
|
17
18
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -74,22 +75,25 @@ class UTRadioGroup extends _react.PureComponent {
|
|
|
74
75
|
render() {
|
|
75
76
|
var _field$configuration;
|
|
76
77
|
const {
|
|
78
|
+
actions,
|
|
77
79
|
classNames = {},
|
|
78
80
|
classes: themeClasses,
|
|
79
81
|
containerClassName,
|
|
80
82
|
field,
|
|
83
|
+
hideLabels,
|
|
81
84
|
input,
|
|
82
85
|
options,
|
|
83
86
|
titleProps,
|
|
84
87
|
withUpperTitle
|
|
85
88
|
} = this.props;
|
|
86
|
-
const shouldShowUpperTitle = (field === null || field === void 0 || (_field$configuration = field.configuration) === null || _field$configuration === void 0 ? void 0 : _field$configuration.ignore_title) && withUpperTitle;
|
|
89
|
+
const shouldShowUpperTitle = ((field === null || field === void 0 || (_field$configuration = field.configuration) === null || _field$configuration === void 0 ? void 0 : _field$configuration.ignore_title) || hideLabels) && withUpperTitle && (field === null || field === void 0 ? void 0 : field.title);
|
|
87
90
|
const classes = (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
88
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, shouldShowUpperTitle && /*#__PURE__*/_react.default.createElement(
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, shouldShowUpperTitle && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, _extends({
|
|
92
|
+
actions: actions,
|
|
93
|
+
className: classes.title,
|
|
94
|
+
readOnly: field.read_only,
|
|
95
|
+
required: field.required
|
|
96
|
+
}, titleProps), field === null || field === void 0 ? void 0 : field.title), /*#__PURE__*/_react.default.createElement(_RadioGroup.default, {
|
|
93
97
|
name: input.name,
|
|
94
98
|
value: input.value || '',
|
|
95
99
|
className: containerClassName,
|
|
@@ -107,6 +111,7 @@ UTRadioGroup.defaultProps = {
|
|
|
107
111
|
valueKey: 'value'
|
|
108
112
|
};
|
|
109
113
|
UTRadioGroup.propTypes = {
|
|
114
|
+
actions: (0, _propTypes.arrayOf)(_buttonTypes.buttonTypes),
|
|
110
115
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
111
116
|
className: _propTypes.string,
|
|
112
117
|
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
@@ -117,6 +122,7 @@ UTRadioGroup.propTypes = {
|
|
|
117
122
|
disableRipple: _propTypes.bool,
|
|
118
123
|
divider: _propTypes.bool,
|
|
119
124
|
field: _formTypes.fieldType,
|
|
125
|
+
hideLabels: _propTypes.bool,
|
|
120
126
|
input: _formTypes.inputPropTypes,
|
|
121
127
|
labelKey: _propTypes.string,
|
|
122
128
|
options: (0, _propTypes.arrayOf)(_propTypes.object),
|
|
@@ -54,7 +54,6 @@ const UTRating = _ref => {
|
|
|
54
54
|
className: "".concat(_stylesModule.default.container, " ").concat(classNames.container),
|
|
55
55
|
"data-testid": dataTestId
|
|
56
56
|
}, title && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
57
|
-
colorTheme: "dark",
|
|
58
57
|
required: required
|
|
59
58
|
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
60
59
|
className: "".concat(_stylesModule.default.optionsContainer, " ").concat(classNames.optionsContainer, " ").concat(isMobileOrTablet ? _stylesModule.default.responsive : '')
|
|
@@ -181,7 +181,7 @@ const UTSelect = _ref => {
|
|
|
181
181
|
className: "".concat(_stylesModule.default.container, " ").concat(className)
|
|
182
182
|
}, title && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
183
183
|
required: required,
|
|
184
|
-
|
|
184
|
+
size: titleVariant
|
|
185
185
|
}, title), /*#__PURE__*/_react.default.createElement(_lab.Autocomplete, {
|
|
186
186
|
disabled: disabled || readOnly,
|
|
187
187
|
getOptionLabel: option => "".concat(option.name),
|
|
@@ -13,7 +13,6 @@ var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
|
13
13
|
var _UTValidation = _interopRequireWildcard(require("../../../UTValidation"));
|
|
14
14
|
var _constants = require("../../../UTBaseInputField/constants");
|
|
15
15
|
var _utils = require("../../../UTValidation/utils");
|
|
16
|
-
var _inputs = require("../../../../constants/inputs.js");
|
|
17
16
|
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
18
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
18
|
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); }
|
|
@@ -58,7 +57,6 @@ const UTTextInput = _ref => {
|
|
|
58
57
|
validations,
|
|
59
58
|
value = null
|
|
60
59
|
} = _ref;
|
|
61
|
-
const titleColorTheme = readOnly ? 'gray' : 'dark';
|
|
62
60
|
const validationData = (0, _react.useMemo)(() => !(0, _isEmpty.default)(validations) ? validations : error && (0, _utils.formatErrorToValidation)(error), [error, validations]);
|
|
63
61
|
const leftAdornments = (0, _react.useMemo)(() => {
|
|
64
62
|
const adornments = [];
|
|
@@ -111,10 +109,10 @@ const UTTextInput = _ref => {
|
|
|
111
109
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
112
110
|
className: "".concat(_stylesModule.default.container, " ").concat(classNames.container)
|
|
113
111
|
}, title && /*#__PURE__*/_react.default.createElement(_UTFieldLabel.default, {
|
|
114
|
-
colorTheme: titleColorTheme,
|
|
115
112
|
dataTestId: labelDataTestId,
|
|
113
|
+
readOnly: readOnly,
|
|
116
114
|
required: required,
|
|
117
|
-
|
|
115
|
+
size: titleVariant
|
|
118
116
|
}, title), /*#__PURE__*/_react.default.createElement(_UTBaseInputField.default, {
|
|
119
117
|
alwaysShowPlaceholder: alwaysShowPlaceholder,
|
|
120
118
|
classNames: classNames,
|
package/dist/index.js
CHANGED
|
@@ -273,6 +273,12 @@ Object.defineProperty(exports, "UTPopUp", {
|
|
|
273
273
|
return _UTPopUp.default;
|
|
274
274
|
}
|
|
275
275
|
});
|
|
276
|
+
Object.defineProperty(exports, "UTPopper", {
|
|
277
|
+
enumerable: true,
|
|
278
|
+
get: function () {
|
|
279
|
+
return _UTPopper.default;
|
|
280
|
+
}
|
|
281
|
+
});
|
|
276
282
|
Object.defineProperty(exports, "UTProductItem", {
|
|
277
283
|
enumerable: true,
|
|
278
284
|
get: function () {
|
|
@@ -499,6 +505,7 @@ var _UTPanel = _interopRequireDefault(require("./components/UTPanel"));
|
|
|
499
505
|
var _UTPasswordField = _interopRequireDefault(require("./components/UTPasswordField"));
|
|
500
506
|
var _UTPhoneInput = _interopRequireDefault(require("./components/UTPhoneInput"));
|
|
501
507
|
var _UTPieChart = _interopRequireDefault(require("./components/UTPieChart"));
|
|
508
|
+
var _UTPopper = _interopRequireDefault(require("./components/UTPopper"));
|
|
502
509
|
var _UTPopUp = _interopRequireDefault(require("./components/UTPopUp"));
|
|
503
510
|
var _UTProductItem = _interopRequireDefault(require("./components/UTProductItem"));
|
|
504
511
|
var _UTProgressBar = _interopRequireDefault(require("./components/UTProgressBar"));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.buttonTypes = void 0;
|
|
7
|
+
var _propTypes = require("prop-types");
|
|
8
|
+
const buttonTypes = exports.buttonTypes = {
|
|
9
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
10
|
+
classNames: (0, _propTypes.objectOf)(_propTypes.string),
|
|
11
|
+
colorTheme: _propTypes.string,
|
|
12
|
+
count: _propTypes.number,
|
|
13
|
+
dataTestId: _propTypes.string,
|
|
14
|
+
disabled: _propTypes.bool,
|
|
15
|
+
hideTextOnResponsive: _propTypes.bool,
|
|
16
|
+
Icon: _propTypes.elementType,
|
|
17
|
+
iconPlacement: _propTypes.string,
|
|
18
|
+
loading: _propTypes.bool,
|
|
19
|
+
onClick: _propTypes.func,
|
|
20
|
+
size: _propTypes.string,
|
|
21
|
+
type: _propTypes.string,
|
|
22
|
+
variant: _propTypes.string
|
|
23
|
+
};
|