@widergy/energy-ui 1.117.6 → 1.120.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 +28 -0
- package/dist/components/UTEmojiPicker/theme.js +19 -18
- package/dist/components/UTPasswordField/components/PasswordValidations/index.js +19 -9
- package/dist/components/UTPasswordField/components/PasswordWarning/index.js +73 -0
- package/dist/components/UTPasswordField/components/PasswordWarning/styles.module.scss +16 -0
- package/dist/components/UTPasswordField/index.js +19 -5
- package/dist/components/UTPasswordField/theme.js +9 -0
- package/dist/components/UTSelect/index.js +45 -34
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,31 @@
|
|
|
1
|
+
# [1.120.0](https://github.com/widergy/energy-ui/compare/v1.119.0...v1.120.0) (2022-05-20)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Features
|
|
5
|
+
|
|
6
|
+
* password recovery ([#288](https://github.com/widergy/energy-ui/issues/288)) ([7860abc](https://github.com/widergy/energy-ui/commit/7860abc532bc0cf3f76cc917008ec6430a2d36cf))
|
|
7
|
+
|
|
8
|
+
# [1.119.0](https://github.com/widergy/energy-ui/compare/v1.118.0...v1.119.0) (2022-05-11)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* fix pr ([1d3b109](https://github.com/widergy/energy-ui/commit/1d3b10982df6a2b6c9298575cae11757a17e82a1))
|
|
14
|
+
* fixed propTypes ([fab740e](https://github.com/widergy/energy-ui/commit/fab740e35c1cea905108256cc87a4467f4ab1c32))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* added formHelperText to UTSelect ([6bf67b7](https://github.com/widergy/energy-ui/commit/6bf67b780b585ebdd42ccfb35d6dedacf12f6061))
|
|
20
|
+
* added formHelperText to UTSelect ([ee6b5f1](https://github.com/widergy/energy-ui/commit/ee6b5f195fd803c064230c4e2a1bbf99119404f4))
|
|
21
|
+
|
|
22
|
+
# [1.118.0](https://github.com/widergy/energy-ui/compare/v1.117.6...v1.118.0) (2022-05-09)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Features
|
|
26
|
+
|
|
27
|
+
* emoji picker theme update ([#285](https://github.com/widergy/energy-ui/issues/285)) ([c80c198](https://github.com/widergy/energy-ui/commit/c80c1988a3e5f015954a945b9442779236bbffe4))
|
|
28
|
+
|
|
1
29
|
## [1.117.6](https://github.com/widergy/energy-ui/compare/v1.117.5...v1.117.6) (2022-04-28)
|
|
2
30
|
|
|
3
31
|
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
|
|
8
8
|
var retrieveStyle = function retrieveStyle(theme) {
|
|
9
|
-
var _theme$UTEmojiPicker, _theme$UTEmojiPicker$, _theme$UTEmojiPicker2, _theme$UTEmojiPicker3, _theme$UTEmojiPicker4, _theme$UTEmojiPicker5, _theme$UTEmojiPicker6, _theme$UTEmojiPicker7, _theme$UTEmojiPicker8, _theme$UTEmojiPicker9, _theme$UTEmojiPicker10, _theme$UTEmojiPicker11, _theme$UTEmojiPicker12, _theme$UTEmojiPicker13, _theme$UTEmojiPicker14, _theme$UTEmojiPicker15, _theme$UTEmojiPicker16, _theme$UTEmojiPicker17, _theme$UTEmojiPicker18, _theme$UTEmojiPicker19, _theme$UTEmojiPicker20, _theme$UTEmojiPicker21, _theme$UTEmojiPicker22, _theme$UTEmojiPicker23, _theme$UTEmojiPicker24, _theme$UTEmojiPicker25, _theme$UTEmojiPicker26, _theme$UTEmojiPicker27, _theme$UTEmojiPicker28, _theme$UTEmojiPicker29, _theme$UTEmojiPicker30, _theme$UTEmojiPicker31, _theme$UTEmojiPicker32, _theme$UTEmojiPicker33, _theme$UTEmojiPicker34, _theme$UTEmojiPicker35, _theme$UTEmojiPicker36, _theme$UTEmojiPicker37, _theme$UTEmojiPicker38, _theme$UTEmojiPicker39, _theme$UTEmojiPicker40, _theme$UTEmojiPicker41, _theme$UTEmojiPicker42, _theme$UTEmojiPicker43, _theme$UTEmojiPicker44, _theme$UTEmojiPicker45, _theme$UTEmojiPicker46, _theme$UTEmojiPicker47;
|
|
9
|
+
var _theme$UTEmojiPicker, _theme$UTEmojiPicker$, _theme$UTEmojiPicker2, _theme$UTEmojiPicker3, _theme$UTEmojiPicker4, _theme$UTEmojiPicker5, _theme$UTEmojiPicker6, _theme$UTEmojiPicker7, _theme$UTEmojiPicker8, _theme$UTEmojiPicker9, _theme$UTEmojiPicker10, _theme$UTEmojiPicker11, _theme$UTEmojiPicker12, _theme$UTEmojiPicker13, _theme$UTEmojiPicker14, _theme$UTEmojiPicker15, _theme$UTEmojiPicker16, _theme$UTEmojiPicker17, _theme$UTEmojiPicker18, _theme$UTEmojiPicker19, _theme$UTEmojiPicker20, _theme$UTEmojiPicker21, _theme$UTEmojiPicker22, _theme$UTEmojiPicker23, _theme$UTEmojiPicker24, _theme$UTEmojiPicker25, _theme$UTEmojiPicker26, _theme$UTEmojiPicker27, _theme$UTEmojiPicker28, _theme$UTEmojiPicker29, _theme$UTEmojiPicker30, _theme$UTEmojiPicker31, _theme$UTEmojiPicker32, _theme$UTEmojiPicker33, _theme$UTEmojiPicker34, _theme$UTEmojiPicker35, _theme$UTEmojiPicker36, _theme$UTEmojiPicker37, _theme$UTEmojiPicker38, _theme$UTEmojiPicker39, _theme$UTEmojiPicker40, _theme$UTEmojiPicker41, _theme$UTEmojiPicker42, _theme$UTEmojiPicker43, _theme$UTEmojiPicker44, _theme$UTEmojiPicker45, _theme$UTEmojiPicker46, _theme$UTEmojiPicker47, _theme$UTEmojiPicker48, _theme$UTEmojiPicker49;
|
|
10
10
|
|
|
11
11
|
return {
|
|
12
12
|
container: {
|
|
@@ -15,35 +15,36 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
15
15
|
left: theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker4 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker4 === void 0 ? void 0 : (_theme$UTEmojiPicker5 = _theme$UTEmojiPicker4.container) === null || _theme$UTEmojiPicker5 === void 0 ? void 0 : _theme$UTEmojiPicker5.left,
|
|
16
16
|
right: theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker6 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker6 === void 0 ? void 0 : (_theme$UTEmojiPicker7 = _theme$UTEmojiPicker6.container) === null || _theme$UTEmojiPicker7 === void 0 ? void 0 : _theme$UTEmojiPicker7.right,
|
|
17
17
|
top: theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker8 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker8 === void 0 ? void 0 : (_theme$UTEmojiPicker9 = _theme$UTEmojiPicker8.container) === null || _theme$UTEmojiPicker9 === void 0 ? void 0 : _theme$UTEmojiPicker9.top,
|
|
18
|
-
bottom: theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker10 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker10 === void 0 ? void 0 : (_theme$UTEmojiPicker11 = _theme$UTEmojiPicker10.container) === null || _theme$UTEmojiPicker11 === void 0 ? void 0 : _theme$UTEmojiPicker11.bottom
|
|
18
|
+
bottom: theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker10 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker10 === void 0 ? void 0 : (_theme$UTEmojiPicker11 = _theme$UTEmojiPicker10.container) === null || _theme$UTEmojiPicker11 === void 0 ? void 0 : _theme$UTEmojiPicker11.bottom,
|
|
19
|
+
borderRadius: theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker12 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker12 === void 0 ? void 0 : (_theme$UTEmojiPicker13 = _theme$UTEmojiPicker12.container) === null || _theme$UTEmojiPicker13 === void 0 ? void 0 : _theme$UTEmojiPicker13.borderRadius
|
|
19
20
|
},
|
|
20
21
|
listContainer: {
|
|
21
|
-
height: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
22
|
-
width: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
22
|
+
height: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker14 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker14 === void 0 ? void 0 : (_theme$UTEmojiPicker15 = _theme$UTEmojiPicker14.listContainer) === null || _theme$UTEmojiPicker15 === void 0 ? void 0 : _theme$UTEmojiPicker15.height) || '216px',
|
|
23
|
+
width: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker16 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker16 === void 0 ? void 0 : (_theme$UTEmojiPicker17 = _theme$UTEmojiPicker16.listContainer) === null || _theme$UTEmojiPicker17 === void 0 ? void 0 : _theme$UTEmojiPicker17.width) || '336px'
|
|
23
24
|
},
|
|
24
25
|
emoji: {
|
|
25
|
-
borderRadius: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
26
|
-
fontSize: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
27
|
-
height: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
28
|
-
width: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
29
|
-
margin: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
26
|
+
borderRadius: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker18 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker18 === void 0 ? void 0 : (_theme$UTEmojiPicker19 = _theme$UTEmojiPicker18.emoji) === null || _theme$UTEmojiPicker19 === void 0 ? void 0 : _theme$UTEmojiPicker19.borderRadius) || '4px',
|
|
27
|
+
fontSize: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker20 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker20 === void 0 ? void 0 : (_theme$UTEmojiPicker21 = _theme$UTEmojiPicker20.emoji) === null || _theme$UTEmojiPicker21 === void 0 ? void 0 : _theme$UTEmojiPicker21.fontSize) || '20px',
|
|
28
|
+
height: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker22 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker22 === void 0 ? void 0 : (_theme$UTEmojiPicker23 = _theme$UTEmojiPicker22.emoji) === null || _theme$UTEmojiPicker23 === void 0 ? void 0 : _theme$UTEmojiPicker23.height) || '32px',
|
|
29
|
+
width: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker24 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker24 === void 0 ? void 0 : (_theme$UTEmojiPicker25 = _theme$UTEmojiPicker24.emoji) === null || _theme$UTEmojiPicker25 === void 0 ? void 0 : _theme$UTEmojiPicker25.width) || '32px',
|
|
30
|
+
margin: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker26 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker26 === void 0 ? void 0 : (_theme$UTEmojiPicker27 = _theme$UTEmojiPicker26.emoji) === null || _theme$UTEmojiPicker27 === void 0 ? void 0 : _theme$UTEmojiPicker27.margin) || '4px',
|
|
30
31
|
'&:hover': {
|
|
31
|
-
backgroundColor: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
32
|
+
backgroundColor: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker28 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker28 === void 0 ? void 0 : (_theme$UTEmojiPicker29 = _theme$UTEmojiPicker28.emoji) === null || _theme$UTEmojiPicker29 === void 0 ? void 0 : (_theme$UTEmojiPicker30 = _theme$UTEmojiPicker29.hover) === null || _theme$UTEmojiPicker30 === void 0 ? void 0 : _theme$UTEmojiPicker30.backgroundColor) || '#E9F0FD'
|
|
32
33
|
}
|
|
33
34
|
},
|
|
34
35
|
groupItem: {
|
|
35
|
-
height: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
36
|
-
stroke: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
37
|
-
fill: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
36
|
+
height: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker31 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker31 === void 0 ? void 0 : (_theme$UTEmojiPicker32 = _theme$UTEmojiPicker31.groupItem) === null || _theme$UTEmojiPicker32 === void 0 ? void 0 : _theme$UTEmojiPicker32.height) || '40px',
|
|
37
|
+
stroke: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker33 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker33 === void 0 ? void 0 : (_theme$UTEmojiPicker34 = _theme$UTEmojiPicker33.groupItem) === null || _theme$UTEmojiPicker34 === void 0 ? void 0 : _theme$UTEmojiPicker34.color) || '#677489',
|
|
38
|
+
fill: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker35 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker35 === void 0 ? void 0 : (_theme$UTEmojiPicker36 = _theme$UTEmojiPicker35.groupItem) === null || _theme$UTEmojiPicker36 === void 0 ? void 0 : _theme$UTEmojiPicker36.color) || '#677489'
|
|
38
39
|
},
|
|
39
40
|
activeIcon: {
|
|
40
|
-
backgroundColor: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
41
|
-
borderRadius: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
42
|
-
stroke: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
41
|
+
backgroundColor: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker37 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker37 === void 0 ? void 0 : (_theme$UTEmojiPicker38 = _theme$UTEmojiPicker37.groupItem) === null || _theme$UTEmojiPicker38 === void 0 ? void 0 : (_theme$UTEmojiPicker39 = _theme$UTEmojiPicker38.active) === null || _theme$UTEmojiPicker39 === void 0 ? void 0 : _theme$UTEmojiPicker39.backgroundColor) || '#E9F0FD',
|
|
42
|
+
borderRadius: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker40 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker40 === void 0 ? void 0 : (_theme$UTEmojiPicker41 = _theme$UTEmojiPicker40.groupItem) === null || _theme$UTEmojiPicker41 === void 0 ? void 0 : (_theme$UTEmojiPicker42 = _theme$UTEmojiPicker41.active) === null || _theme$UTEmojiPicker42 === void 0 ? void 0 : _theme$UTEmojiPicker42.borderRadius) || '5px',
|
|
43
|
+
stroke: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker43 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker43 === void 0 ? void 0 : (_theme$UTEmojiPicker44 = _theme$UTEmojiPicker43.groupItem) === null || _theme$UTEmojiPicker44 === void 0 ? void 0 : (_theme$UTEmojiPicker45 = _theme$UTEmojiPicker44.active) === null || _theme$UTEmojiPicker45 === void 0 ? void 0 : _theme$UTEmojiPicker45.color) || '#2b70fb'
|
|
43
44
|
},
|
|
44
45
|
groups: {
|
|
45
|
-
borderBottom: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
46
|
-
padding: (theme === null || theme === void 0 ? void 0 : (_theme$
|
|
46
|
+
borderBottom: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker46 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker46 === void 0 ? void 0 : (_theme$UTEmojiPicker47 = _theme$UTEmojiPicker46.groups) === null || _theme$UTEmojiPicker47 === void 0 ? void 0 : _theme$UTEmojiPicker47.borderBottom) || '1px solid #E4E6EA',
|
|
47
|
+
padding: (theme === null || theme === void 0 ? void 0 : (_theme$UTEmojiPicker48 = theme.UTEmojiPicker) === null || _theme$UTEmojiPicker48 === void 0 ? void 0 : (_theme$UTEmojiPicker49 = _theme$UTEmojiPicker48.groups) === null || _theme$UTEmojiPicker49 === void 0 ? void 0 : _theme$UTEmojiPicker49.padding) || '8px'
|
|
47
48
|
}
|
|
48
49
|
};
|
|
49
50
|
};
|
|
@@ -44,7 +44,8 @@ var PasswordValidations = function PasswordValidations(_ref) {
|
|
|
44
44
|
ErrorIcon = _ref.ErrorIcon,
|
|
45
45
|
NoValueIcon = _ref.NoValueIcon,
|
|
46
46
|
meta = _ref.meta,
|
|
47
|
-
disabled = _ref.disabled
|
|
47
|
+
disabled = _ref.disabled,
|
|
48
|
+
passwordValidationsWarning = _ref.passwordValidationsWarning;
|
|
48
49
|
var validatedRegExps = passwordValidations.map(function (_ref2) {
|
|
49
50
|
var expression = _ref2.expression,
|
|
50
51
|
regex = _objectWithoutProperties(_ref2, _excluded);
|
|
@@ -64,12 +65,16 @@ var PasswordValidations = function PasswordValidations(_ref) {
|
|
|
64
65
|
return !requirement;
|
|
65
66
|
});
|
|
66
67
|
var showErrors = errors.some(function (_ref5) {
|
|
67
|
-
var assertion = _ref5.assertion
|
|
68
|
-
|
|
68
|
+
var assertion = _ref5.assertion,
|
|
69
|
+
error = _ref5.error;
|
|
70
|
+
return !assertion && !(passwordValidationsWarning !== null && passwordValidationsWarning !== void 0 && passwordValidationsWarning.some(function (_ref6) {
|
|
71
|
+
var warningError = _ref6.error;
|
|
72
|
+
return error === warningError;
|
|
73
|
+
}));
|
|
69
74
|
});
|
|
70
|
-
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map(function (
|
|
71
|
-
var requirement =
|
|
72
|
-
assertion =
|
|
75
|
+
return /*#__PURE__*/_react.default.createElement(_react.Fragment, null, validations.map(function (_ref7) {
|
|
76
|
+
var requirement = _ref7.requirement,
|
|
77
|
+
assertion = _ref7.assertion;
|
|
73
78
|
return /*#__PURE__*/_react.default.createElement(_Validation.default, {
|
|
74
79
|
disabled: disabled,
|
|
75
80
|
ValidationFailedIcon: ValidationFailedIcon,
|
|
@@ -83,9 +88,9 @@ var PasswordValidations = function PasswordValidations(_ref) {
|
|
|
83
88
|
});
|
|
84
89
|
}), submitFailed && showErrors && /*#__PURE__*/_react.default.createElement("div", {
|
|
85
90
|
className: errorsContainerStyle
|
|
86
|
-
}, errors.map(function (
|
|
87
|
-
var error =
|
|
88
|
-
assertion =
|
|
91
|
+
}, errors.map(function (_ref8) {
|
|
92
|
+
var error = _ref8.error,
|
|
93
|
+
assertion = _ref8.assertion;
|
|
89
94
|
return /*#__PURE__*/_react.default.createElement(_Error.default, {
|
|
90
95
|
ErrorIcon: ErrorIcon,
|
|
91
96
|
classes: classes,
|
|
@@ -101,6 +106,11 @@ PasswordValidations.propTypes = {
|
|
|
101
106
|
requirement: _propTypes.string,
|
|
102
107
|
error: _propTypes.string
|
|
103
108
|
})),
|
|
109
|
+
passwordValidationsWarning: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
110
|
+
expression: _propTypes.string,
|
|
111
|
+
requirement: _propTypes.string,
|
|
112
|
+
error: _propTypes.string
|
|
113
|
+
})),
|
|
104
114
|
value: _propTypes.string,
|
|
105
115
|
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
106
116
|
ValidationFailedIcon: _propTypes.elementType,
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
var _propTypes = require("prop-types");
|
|
11
|
+
|
|
12
|
+
var _Divider = _interopRequireDefault(require("@material-ui/core/Divider"));
|
|
13
|
+
|
|
14
|
+
var _UTLabel = _interopRequireDefault(require("../../../UTLabel"));
|
|
15
|
+
|
|
16
|
+
var _stylesModule = _interopRequireDefault(require("./styles.module.scss"));
|
|
17
|
+
|
|
18
|
+
var _excluded = ["expression"];
|
|
19
|
+
|
|
20
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
|
+
|
|
22
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
23
|
+
|
|
24
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
25
|
+
|
|
26
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
27
|
+
|
|
28
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
29
|
+
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
|
+
|
|
32
|
+
var PasswordWarning = function PasswordWarning(_ref) {
|
|
33
|
+
var classes = _ref.classes,
|
|
34
|
+
passwordValidationsWarning = _ref.passwordValidationsWarning,
|
|
35
|
+
value = _ref.value,
|
|
36
|
+
WarningIcon = _ref.WarningIcon;
|
|
37
|
+
var warningLabel = classes.warningLabel,
|
|
38
|
+
warningDivider = classes.warningDivider;
|
|
39
|
+
var validatedRegExps = passwordValidationsWarning.map(function (_ref2) {
|
|
40
|
+
var expression = _ref2.expression,
|
|
41
|
+
regex = _objectWithoutProperties(_ref2, _excluded);
|
|
42
|
+
|
|
43
|
+
return _objectSpread({
|
|
44
|
+
assertion: new RegExp(expression).test(value)
|
|
45
|
+
}, regex);
|
|
46
|
+
});
|
|
47
|
+
return validatedRegExps.map(function (_ref3) {
|
|
48
|
+
var error = _ref3.error,
|
|
49
|
+
assertion = _ref3.assertion;
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
51
|
+
className: assertion ? _stylesModule.default.hide : _stylesModule.default.warningContainer
|
|
52
|
+
}, /*#__PURE__*/_react.default.createElement(_Divider.default, {
|
|
53
|
+
className: warningDivider
|
|
54
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
55
|
+
className: _stylesModule.default.iconAndLabelContainer
|
|
56
|
+
}, /*#__PURE__*/_react.default.createElement(WarningIcon, null), /*#__PURE__*/_react.default.createElement(_UTLabel.default, {
|
|
57
|
+
className: "".concat(_stylesModule.default.warning, " ").concat(warningLabel)
|
|
58
|
+
}, error)));
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
PasswordWarning.propTypes = {
|
|
63
|
+
classes: (0, _propTypes.objectOf)(_propTypes.string),
|
|
64
|
+
passwordValidationsWarning: (0, _propTypes.arrayOf)((0, _propTypes.shape)({
|
|
65
|
+
expression: _propTypes.string,
|
|
66
|
+
requirement: _propTypes.string,
|
|
67
|
+
error: _propTypes.string
|
|
68
|
+
})),
|
|
69
|
+
value: _propTypes.string,
|
|
70
|
+
WarningIcon: _propTypes.elementType
|
|
71
|
+
};
|
|
72
|
+
var _default = PasswordWarning;
|
|
73
|
+
exports.default = _default;
|
|
@@ -19,7 +19,9 @@ var _theme = require("./theme");
|
|
|
19
19
|
|
|
20
20
|
var _PasswordValidations = _interopRequireDefault(require("./components/PasswordValidations"));
|
|
21
21
|
|
|
22
|
-
var
|
|
22
|
+
var _PasswordWarning = _interopRequireDefault(require("./components/PasswordWarning"));
|
|
23
|
+
|
|
24
|
+
var _excluded = ["field", "input", "classes", "ValidationPassedIcon", "ValidationFailedIcon", "NoValueIcon", "ErrorIcon", "meta", "disabled", "WarningIcon"];
|
|
23
25
|
|
|
24
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
25
27
|
|
|
@@ -40,11 +42,14 @@ var UTPasswordField = function UTPasswordField(_ref) {
|
|
|
40
42
|
ErrorIcon = _ref.ErrorIcon,
|
|
41
43
|
meta = _ref.meta,
|
|
42
44
|
disabled = _ref.disabled,
|
|
45
|
+
WarningIcon = _ref.WarningIcon,
|
|
43
46
|
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
44
47
|
|
|
45
48
|
var passwordValidations = field.passwordValidations,
|
|
46
|
-
showValidations = field.showValidations
|
|
49
|
+
showValidations = field.showValidations,
|
|
50
|
+
passwordValidationsWarning = field.passwordValidationsWarning;
|
|
47
51
|
var value = input.value;
|
|
52
|
+
var validationContainer = classes.validationContainer;
|
|
48
53
|
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_UTTextInput.default, _extends({
|
|
49
54
|
field: field,
|
|
50
55
|
input: input,
|
|
@@ -52,7 +57,9 @@ var UTPasswordField = function UTPasswordField(_ref) {
|
|
|
52
57
|
disabled: disabled
|
|
53
58
|
}, otherProps, {
|
|
54
59
|
type: "password"
|
|
55
|
-
})), showValidations && passwordValidations && /*#__PURE__*/_react.default.createElement(
|
|
60
|
+
})), showValidations && passwordValidations && /*#__PURE__*/_react.default.createElement("div", {
|
|
61
|
+
className: validationContainer
|
|
62
|
+
}, /*#__PURE__*/_react.default.createElement(_PasswordValidations.default, {
|
|
56
63
|
disabled: disabled,
|
|
57
64
|
ErrorIcon: ErrorIcon,
|
|
58
65
|
ValidationFailedIcon: ValidationFailedIcon,
|
|
@@ -61,7 +68,13 @@ var UTPasswordField = function UTPasswordField(_ref) {
|
|
|
61
68
|
value: value,
|
|
62
69
|
classes: classes,
|
|
63
70
|
meta: meta,
|
|
64
|
-
passwordValidations: passwordValidations
|
|
71
|
+
passwordValidations: passwordValidations,
|
|
72
|
+
passwordValidationsWarning: passwordValidationsWarning
|
|
73
|
+
})), showValidations && passwordValidationsWarning && /*#__PURE__*/_react.default.createElement(_PasswordWarning.default, {
|
|
74
|
+
classes: classes,
|
|
75
|
+
passwordValidationsWarning: passwordValidationsWarning,
|
|
76
|
+
value: value,
|
|
77
|
+
WarningIcon: WarningIcon
|
|
65
78
|
}));
|
|
66
79
|
};
|
|
67
80
|
|
|
@@ -79,7 +92,8 @@ UTPasswordField.propTypes = {
|
|
|
79
92
|
placeholder: _propTypes.string,
|
|
80
93
|
label: _propTypes.string,
|
|
81
94
|
meta: _formTypes.metaPropTypes,
|
|
82
|
-
disabled: _propTypes.bool
|
|
95
|
+
disabled: _propTypes.bool,
|
|
96
|
+
WarningIcon: _propTypes.elementType
|
|
83
97
|
};
|
|
84
98
|
|
|
85
99
|
var _default = (0, _WithTheme.default)(_theme.retrieveStyle)(UTPasswordField);
|
|
@@ -38,6 +38,15 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
38
38
|
errorsContainerStyle: {
|
|
39
39
|
borderTop: "1px solid ".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'], _colors.default.red)),
|
|
40
40
|
marginTop: '7px'
|
|
41
|
+
},
|
|
42
|
+
warningLabel: {
|
|
43
|
+
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'warningLabel', 'color']), " !important")
|
|
44
|
+
},
|
|
45
|
+
warningDivider: {
|
|
46
|
+
backgroundColor: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'warningLabel', 'color']), " !important")
|
|
47
|
+
},
|
|
48
|
+
validationContainer: {
|
|
49
|
+
margin: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'validationContainer', 'margin']), " !important")
|
|
41
50
|
}
|
|
42
51
|
};
|
|
43
52
|
};
|
|
@@ -59,6 +59,12 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
59
59
|
|
|
60
60
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
61
61
|
|
|
62
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
63
|
+
|
|
64
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
65
|
+
|
|
66
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
67
|
+
|
|
62
68
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
63
69
|
|
|
64
70
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -74,25 +80,26 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
74
80
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
75
81
|
|
|
76
82
|
var UTSelect = function UTSelect(_ref) {
|
|
77
|
-
var
|
|
78
|
-
|
|
83
|
+
var captionLabel = _ref.captionLabel,
|
|
84
|
+
classes = _ref.classes,
|
|
85
|
+
disabled = _ref.disabled,
|
|
86
|
+
disableFirstOption = _ref.disableFirstOption,
|
|
87
|
+
field = _ref.field,
|
|
88
|
+
IconPlaceholder = _ref.iconPlaceholder,
|
|
89
|
+
input = _ref.input,
|
|
79
90
|
labelKey = _ref.labelKey,
|
|
80
|
-
|
|
91
|
+
labelProps = _ref.labelProps,
|
|
81
92
|
menuPlaceholder = _ref.menuPlaceholder,
|
|
82
93
|
meta = _ref.meta,
|
|
83
|
-
|
|
94
|
+
options = _ref.options,
|
|
84
95
|
placeholder = _ref.placeholder,
|
|
85
|
-
|
|
96
|
+
selectProps = _ref.selectProps,
|
|
86
97
|
tooltip = _ref.tooltip,
|
|
87
|
-
|
|
88
|
-
IconPlaceholder = _ref.iconPlaceholder,
|
|
89
|
-
field = _ref.field,
|
|
98
|
+
valueKey = _ref.valueKey,
|
|
90
99
|
variant = _ref.variant,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
withoutFirstOption = _ref.withoutFirstOption,
|
|
95
|
-
withAutoReset = _ref.withAutoReset;
|
|
100
|
+
withAutoReset = _ref.withAutoReset,
|
|
101
|
+
withOrder = _ref.withOrder,
|
|
102
|
+
withoutFirstOption = _ref.withoutFirstOption;
|
|
96
103
|
|
|
97
104
|
var _ref2 = (field === null || field === void 0 ? void 0 : field.configuration) || {},
|
|
98
105
|
isMultiple = _ref2.multiple,
|
|
@@ -174,7 +181,9 @@ var UTSelect = function UTSelect(_ref) {
|
|
|
174
181
|
optionProps: subOption
|
|
175
182
|
}, optionCommonProps)));
|
|
176
183
|
})];
|
|
177
|
-
})),
|
|
184
|
+
})), captionLabel && /*#__PURE__*/_react.default.createElement(_FormHelperText.default, {
|
|
185
|
+
classes: _objectSpread({}, classes.formHelperText)
|
|
186
|
+
}, captionLabel), (0, _form.shouldShowErrors)(meta) && /*#__PURE__*/_react.default.createElement(_FormHelperText.default, null, meta.error)));
|
|
178
187
|
|
|
179
188
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
180
189
|
className: classes.container
|
|
@@ -197,49 +206,51 @@ var UTSelect = function UTSelect(_ref) {
|
|
|
197
206
|
};
|
|
198
207
|
|
|
199
208
|
UTSelect.defaultProps = {
|
|
200
|
-
withoutFirstOption: false,
|
|
201
|
-
options: [],
|
|
202
209
|
classes: {},
|
|
203
210
|
field: {
|
|
204
211
|
configuration: {
|
|
205
212
|
multiple: false
|
|
206
213
|
}
|
|
207
214
|
},
|
|
208
|
-
|
|
215
|
+
labelKey: _constants.LABEL_KEY,
|
|
209
216
|
labelProps: {},
|
|
210
217
|
meta: {},
|
|
218
|
+
options: [],
|
|
219
|
+
selectProps: {},
|
|
211
220
|
valueKey: _constants.VALUE_KEY,
|
|
212
|
-
|
|
213
|
-
|
|
221
|
+
withAutoReset: true,
|
|
222
|
+
withoutFirstOption: false
|
|
214
223
|
};
|
|
215
224
|
UTSelect.propTypes = {
|
|
216
|
-
|
|
217
|
-
input: _formTypes.inputPropTypes.isRequired,
|
|
218
|
-
iconPlaceholder: _propTypes.node,
|
|
219
|
-
meta: _formTypes.metaPropTypes,
|
|
220
|
-
disabled: _propTypes.bool,
|
|
221
|
-
valueKey: _propTypes.string,
|
|
222
|
-
labelKey: _propTypes.string,
|
|
223
|
-
placeholder: _propTypes.string,
|
|
224
|
-
withOrder: _propTypes.bool,
|
|
225
|
-
options: (0, _propTypes.arrayOf)(_propTypes.object),
|
|
226
|
-
tooltip: _propTypes.string,
|
|
227
|
-
menuPlaceholder: _propTypes.string,
|
|
225
|
+
captionLabel: _propTypes.string,
|
|
228
226
|
classes: (0, _propTypes.shape)({
|
|
229
227
|
container: _propTypes.string,
|
|
230
228
|
labelContainer: _propTypes.string,
|
|
231
229
|
formControl: _propTypes.string,
|
|
230
|
+
formHelperText: (0, _propTypes.objectOf)(_propTypes.string),
|
|
232
231
|
labelIcon: _propTypes.string,
|
|
233
232
|
optionIcon: _propTypes.string,
|
|
234
233
|
tooltipIcon: _propTypes.string,
|
|
235
234
|
upperTitle: _propTypes.string
|
|
236
235
|
}),
|
|
236
|
+
disabled: _propTypes.bool,
|
|
237
|
+
disableFirstOption: _propTypes.bool,
|
|
237
238
|
field: _formTypes.fieldType,
|
|
239
|
+
iconPlaceholder: _propTypes.node,
|
|
240
|
+
input: _formTypes.inputPropTypes.isRequired,
|
|
241
|
+
labelKey: _propTypes.string,
|
|
242
|
+
labelProps: _propTypes.object,
|
|
243
|
+
menuPlaceholder: _propTypes.string,
|
|
244
|
+
meta: _formTypes.metaPropTypes,
|
|
245
|
+
options: (0, _propTypes.arrayOf)(_propTypes.object),
|
|
246
|
+
placeholder: _propTypes.string,
|
|
247
|
+
selectProps: _propTypes.object,
|
|
248
|
+
tooltip: _propTypes.string,
|
|
249
|
+
valueKey: _propTypes.string,
|
|
238
250
|
variant: _propTypes.string,
|
|
239
|
-
disableFirstOption: _propTypes.bool,
|
|
240
251
|
withAutoReset: _propTypes.bool,
|
|
241
|
-
|
|
242
|
-
|
|
252
|
+
withOrder: _propTypes.bool,
|
|
253
|
+
withoutFirstOption: _propTypes.bool
|
|
243
254
|
};
|
|
244
255
|
|
|
245
256
|
var _default = (0, _WithTheme.default)(_theme.retrieveStyle, _theme.retrieveMuiTheme)(UTSelect);
|