@widergy/energy-ui 3.22.4 → 3.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/dist/components/UTActionCard/README.md +2 -2
- package/dist/components/UTActionCard/components/AdditionalMessage/index.js +3 -1
- package/dist/components/UTActionCard/components/BottomActions/index.js +5 -3
- package/dist/components/UTActionCard/components/BottomActions/styles.module.scss +4 -0
- package/dist/components/UTActionCard/components/Header/constants.js +14 -1
- package/dist/components/UTActionCard/components/Header/index.js +5 -3
- package/dist/components/UTActionCard/components/Header/styles.module.scss +6 -8
- package/dist/components/UTActionCard/components/HeaderActions/index.js +9 -6
- package/dist/components/UTActionCard/components/HeaderActions/utils.js +26 -15
- package/dist/components/UTActionCard/index.js +7 -9
- package/dist/components/UTFieldLabel/constants.js +7 -0
- package/dist/components/UTFieldLabel/index.js +43 -0
- package/dist/components/UTFieldLabel/styles.module.scss +5 -0
- package/dist/components/UTIcon/styles.module.scss +0 -1
- package/dist/components/UTLabel/theme.js +24 -8
- package/dist/components/UTTextArea/index.js +11 -87
- package/dist/components/UTTextArea/versions/V0/index.js +102 -0
- package/dist/components/UTTextArea/{theme.js → versions/V0/theme.js} +1 -1
- package/dist/components/UTTextArea/versions/V1/README.md +33 -0
- package/dist/components/UTTextArea/versions/V1/index.js +18 -0
- package/dist/components/UTTextInput/index.js +15 -200
- package/dist/components/UTTextInput/versions/V0/index.js +211 -0
- package/dist/components/UTTextInput/{styles.module.scss → versions/V0/styles.module.scss} +1 -1
- package/dist/components/UTTextInput/{theme.js → versions/V0/theme.js} +1 -1
- package/dist/components/UTTextInput/versions/V1/README.md +85 -0
- package/dist/components/UTTextInput/versions/V1/components/ActionAdornment/index.js +31 -0
- package/dist/components/UTTextInput/versions/V1/components/IconAdornment/constants.js +8 -0
- package/dist/components/UTTextInput/versions/V1/components/IconAdornment/index.js +48 -0
- package/dist/components/UTTextInput/versions/V1/components/IconAdornment/utils.js +17 -0
- package/dist/components/UTTextInput/versions/V1/components/PrefixAdornment/index.js +24 -0
- package/dist/components/UTTextInput/versions/V1/components/SuffixAdornment/index.js +22 -0
- package/dist/components/UTTextInput/versions/V1/components/TooltipAdornment/index.js +26 -0
- package/dist/components/UTTextInput/versions/V1/index.js +177 -0
- package/dist/components/UTTextInput/versions/V1/styles.module.scss +29 -0
- package/dist/components/UTTextInput/versions/V1/theme.js +94 -0
- package/dist/components/UTValidation/README.md +68 -0
- package/dist/components/UTValidation/constants.js +27 -0
- package/dist/components/UTValidation/index.js +86 -0
- package/dist/components/UTValidation/styles.module.scss +33 -0
- package/dist/components/UTValidation/theme.js +25 -0
- package/dist/components/UTValidation/utils.js +23 -0
- package/dist/index.js +7 -0
- package/package.json +1 -1
- package/dist/components/UTActionCard/components/HeaderActions/constants.js +0 -7
- /package/dist/components/UTTextArea/{constants.js → versions/V0/constants.js} +0 -0
- /package/dist/components/UTTextArea/{styles.module.scss → versions/V0/styles.module.scss} +0 -0
- /package/dist/components/UTTextInput/{constants.js → versions/V0/constants.js} +0 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.validationDataProptypes = exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _lodash = require("lodash");
|
|
9
|
+
var _propTypes = require("prop-types");
|
|
10
|
+
var _componentUtils = require("../../utils/componentUtils");
|
|
11
|
+
var _UTIcon = _interopRequireDefault(require("../UTIcon"));
|
|
12
|
+
var _UTLabel = _interopRequireDefault(require("../UTLabel"));
|
|
13
|
+
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
14
|
+
var _constants = require("./constants");
|
|
15
|
+
var _utils = require("./utils");
|
|
16
|
+
var _theme = require("./theme");
|
|
17
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
18
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
19
|
+
const UTValidation = _ref => {
|
|
20
|
+
let {
|
|
21
|
+
classes,
|
|
22
|
+
className,
|
|
23
|
+
validationData = []
|
|
24
|
+
} = _ref;
|
|
25
|
+
if ((0, _lodash.isEmpty)(validationData)) return null;
|
|
26
|
+
const showIcon = status => _constants.STATUSES_WITH_ICON.includes(status);
|
|
27
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
28
|
+
className: "".concat(className, " ").concat(_stylesModule.default.container)
|
|
29
|
+
}, validationData.map((_ref2, index) => {
|
|
30
|
+
let {
|
|
31
|
+
items,
|
|
32
|
+
status = _constants.STATUSES.default,
|
|
33
|
+
title
|
|
34
|
+
} = _ref2;
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
key: (0, _utils.generateKey)({
|
|
37
|
+
items,
|
|
38
|
+
status,
|
|
39
|
+
title
|
|
40
|
+
}, index),
|
|
41
|
+
className: _stylesModule.default.validationContainer
|
|
42
|
+
}, title && /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
43
|
+
colorTheme: _constants.STATUS_COLOR_MAPPER[status],
|
|
44
|
+
variant: "small"
|
|
45
|
+
}, title), /*#__PURE__*/_react.default.createElement("div", {
|
|
46
|
+
className: _stylesModule.default.itemsContainer
|
|
47
|
+
}, items.map((_ref3, itemIndex) => {
|
|
48
|
+
let {
|
|
49
|
+
text,
|
|
50
|
+
status: itemStatus = _constants.STATUSES.default,
|
|
51
|
+
withIcon = true
|
|
52
|
+
} = _ref3;
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
+
key: (0, _utils.generateItemKey)({
|
|
55
|
+
text,
|
|
56
|
+
status: itemStatus
|
|
57
|
+
}, itemIndex),
|
|
58
|
+
className: _stylesModule.default.itemContainer
|
|
59
|
+
}, withIcon && /*#__PURE__*/_react.default.createElement("div", {
|
|
60
|
+
className: "".concat(_stylesModule.default.iconContainer, " ").concat(classes["icon".concat((0, _componentUtils.capitalize)(itemStatus))])
|
|
61
|
+
}, showIcon(itemStatus) && /*#__PURE__*/_react.default.createElement(_UTIcon.default, {
|
|
62
|
+
colorTheme: itemStatus,
|
|
63
|
+
name: _constants.ICON_MAPPER[itemStatus],
|
|
64
|
+
size: _constants.ICON_SIZE
|
|
65
|
+
})), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
66
|
+
colorTheme: _constants.STATUS_COLOR_MAPPER[itemStatus],
|
|
67
|
+
variant: "small"
|
|
68
|
+
}, text));
|
|
69
|
+
})));
|
|
70
|
+
}));
|
|
71
|
+
};
|
|
72
|
+
const validationDataProptypes = exports.validationDataProptypes = (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
73
|
+
items: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
74
|
+
status: _propTypes.string,
|
|
75
|
+
text: _propTypes.string,
|
|
76
|
+
withIcon: _propTypes.bool
|
|
77
|
+
})),
|
|
78
|
+
status: _propTypes.string,
|
|
79
|
+
title: _propTypes.string
|
|
80
|
+
}));
|
|
81
|
+
UTValidation.propTypes = {
|
|
82
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
83
|
+
className: _propTypes.string,
|
|
84
|
+
validationData: validationDataProptypes
|
|
85
|
+
};
|
|
86
|
+
var _default = exports.default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTValidation);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
grid-gap: 16px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.iconContainer {
|
|
8
|
+
align-items: center;
|
|
9
|
+
border-radius: 100%;
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 20px;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
width: 20px;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.itemContainer {
|
|
17
|
+
align-items: center;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
grid-gap: 8px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.itemsContainer {
|
|
24
|
+
display: flex;
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
grid-gap: 8px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.validationContainer {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
grid-gap: 12px;
|
|
33
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.retrieveStyle = void 0;
|
|
7
|
+
var _constants = require("./constants");
|
|
8
|
+
const variantsColorTheme = (colorTheme, theme) => theme.Palette[colorTheme];
|
|
9
|
+
const retrieveStyle = _ref => {
|
|
10
|
+
let {
|
|
11
|
+
theme
|
|
12
|
+
} = _ref;
|
|
13
|
+
return {
|
|
14
|
+
iconSuccess: {
|
|
15
|
+
backgroundColor: variantsColorTheme(_constants.ICON_STATUS_COLOR_MAPPER[_constants.STATUSES.success], theme)['01']
|
|
16
|
+
},
|
|
17
|
+
iconError: {
|
|
18
|
+
backgroundColor: variantsColorTheme(_constants.ICON_STATUS_COLOR_MAPPER[_constants.STATUSES.error], theme)['01']
|
|
19
|
+
},
|
|
20
|
+
iconDefault: {
|
|
21
|
+
backgroundColor: variantsColorTheme(_constants.ICON_STATUS_COLOR_MAPPER[_constants.STATUSES.default], theme)['04']
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
exports.retrieveStyle = retrieveStyle;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.generateKey = exports.generateItemKey = exports.formatErrorToValidation = void 0;
|
|
7
|
+
const generateKey = (data, index) => {
|
|
8
|
+
const titleKey = data.title || '';
|
|
9
|
+
const statusKey = data.status || '';
|
|
10
|
+
const itemsKey = data.items.map(item => item.text).join('-');
|
|
11
|
+
return "".concat(index, "-").concat(titleKey, "-").concat(statusKey, "-").concat(itemsKey);
|
|
12
|
+
};
|
|
13
|
+
exports.generateKey = generateKey;
|
|
14
|
+
const generateItemKey = (item, index) => "".concat(index, "-").concat(item.status, "-").concat(item.text);
|
|
15
|
+
exports.generateItemKey = generateItemKey;
|
|
16
|
+
const formatErrorToValidation = (error, options) => [{
|
|
17
|
+
items: [{
|
|
18
|
+
text: error,
|
|
19
|
+
status: 'error',
|
|
20
|
+
withIcon: options === null || options === void 0 ? void 0 : options.withIcon
|
|
21
|
+
}]
|
|
22
|
+
}];
|
|
23
|
+
exports.formatErrorToValidation = formatErrorToValidation;
|
package/dist/index.js
CHANGED
|
@@ -381,6 +381,12 @@ Object.defineProperty(exports, "UTTracker", {
|
|
|
381
381
|
return _UTTracker.default;
|
|
382
382
|
}
|
|
383
383
|
});
|
|
384
|
+
Object.defineProperty(exports, "UTValidation", {
|
|
385
|
+
enumerable: true,
|
|
386
|
+
get: function () {
|
|
387
|
+
return _UTValidation.default;
|
|
388
|
+
}
|
|
389
|
+
});
|
|
384
390
|
Object.defineProperty(exports, "UTVirtualizedList", {
|
|
385
391
|
enumerable: true,
|
|
386
392
|
get: function () {
|
|
@@ -475,6 +481,7 @@ var _UTTooltip = _interopRequireDefault(require("./components/UTTooltip"));
|
|
|
475
481
|
var _UTTopbar = _interopRequireDefault(require("./components/UTTopbar"));
|
|
476
482
|
var _UTTouchableWithoutFeedback = _interopRequireDefault(require("./components/UTTouchableWithoutFeedback"));
|
|
477
483
|
var _UTTracker = _interopRequireDefault(require("./components/UTTracker"));
|
|
484
|
+
var _UTValidation = _interopRequireDefault(require("./components/UTValidation"));
|
|
478
485
|
var _UTVirtualizedList = _interopRequireDefault(require("./components/UTVirtualizedList"));
|
|
479
486
|
var _UTWorkflowContainer = _interopRequireDefault(require("./components/UTWorkflowContainer"));
|
|
480
487
|
var _WithLoading = _interopRequireDefault(require("./components/WithLoading"));
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|