@widergy/energy-ui 1.134.4 → 1.134.6
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.
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
var _propTypes = require("prop-types");
|
|
10
|
+
var _reactRedux = require("react-redux");
|
|
10
11
|
var _WithTheme = _interopRequireDefault(require("../WithTheme"));
|
|
11
12
|
var _UTMenu = _interopRequireDefault(require("../UTMenu"));
|
|
12
13
|
var _UTTouchableWithoutFeedback = _interopRequireDefault(require("../UTTouchableWithoutFeedback"));
|
|
@@ -42,8 +43,10 @@ var UTBreadcrumbs = function UTBreadcrumbs(_ref) {
|
|
|
42
43
|
_ref$menuProps = _ref.menuProps,
|
|
43
44
|
menuProps = _ref$menuProps === void 0 ? {} : _ref$menuProps,
|
|
44
45
|
onRedirect = _ref.onRedirect,
|
|
46
|
+
onSetAction = _ref.onSetAction,
|
|
45
47
|
_ref$separator = _ref.separator,
|
|
46
48
|
separator = _ref$separator === void 0 ? _constants.DEFAULT_SEPARATOR : _ref$separator;
|
|
49
|
+
var dispatch = (0, _reactRedux.useDispatch)();
|
|
47
50
|
var classes = (0, _react.useMemo)(function () {
|
|
48
51
|
return (0, _classesUtils.mergeClasses)(themeClasses, classNames);
|
|
49
52
|
}, [classNames]);
|
|
@@ -118,6 +121,20 @@ var UTBreadcrumbs = function UTBreadcrumbs(_ref) {
|
|
|
118
121
|
items: []
|
|
119
122
|
});
|
|
120
123
|
};
|
|
124
|
+
var handleClickOptions = function handleClickOptions(options, route, id) {
|
|
125
|
+
var indexOfCurrentBreadcrumb = breadcrumbs.findIndex(function (breadcrumb) {
|
|
126
|
+
return breadcrumb.id === id;
|
|
127
|
+
});
|
|
128
|
+
if (indexOfCurrentBreadcrumb !== breadcrumbs.length - 1) {
|
|
129
|
+
if (options.setAction) {
|
|
130
|
+
onSetAction(options.setAction, options.params);
|
|
131
|
+
}
|
|
132
|
+
if (options.updatedBreadcrumbs) {
|
|
133
|
+
dispatch(options.updatedBreadcrumbs(breadcrumbs.slice(0, indexOfCurrentBreadcrumb + 1)));
|
|
134
|
+
}
|
|
135
|
+
onRedirect(route);
|
|
136
|
+
}
|
|
137
|
+
};
|
|
121
138
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
122
139
|
className: _stylesModule.default.breadcrumbs,
|
|
123
140
|
ref: containerRef
|
|
@@ -125,23 +142,29 @@ var UTBreadcrumbs = function UTBreadcrumbs(_ref) {
|
|
|
125
142
|
var route = _ref3.route,
|
|
126
143
|
label = _ref3.label,
|
|
127
144
|
menuItems = _ref3.menuItems,
|
|
128
|
-
itemClassName = _ref3.itemClassName
|
|
145
|
+
itemClassName = _ref3.itemClassName,
|
|
146
|
+
_ref3$options = _ref3.options,
|
|
147
|
+
options = _ref3$options === void 0 ? {} : _ref3$options,
|
|
148
|
+
_ref3$id = _ref3.id,
|
|
149
|
+
id = _ref3$id === void 0 ? Math.random() : _ref3$id;
|
|
129
150
|
var handleClick = function handleClick(event) {
|
|
130
151
|
if (menuItems) setMenu({
|
|
131
152
|
anchor: event.currentTarget,
|
|
132
153
|
items: _toConsumableArray(menuItems).map(function (_ref4) {
|
|
133
154
|
var menuItemLabel = _ref4.label,
|
|
134
|
-
menuItemRoute = _ref4.route
|
|
155
|
+
menuItemRoute = _ref4.route,
|
|
156
|
+
menuItemOptions = _ref4.options,
|
|
157
|
+
menuItemId = _ref4.id;
|
|
135
158
|
return {
|
|
136
159
|
label: menuItemLabel,
|
|
137
160
|
onClick: function onClick() {
|
|
138
161
|
setContent(breadcrumbs);
|
|
139
162
|
handleCloseMenu();
|
|
140
|
-
|
|
163
|
+
handleClickOptions(menuItemOptions, menuItemRoute, menuItemId);
|
|
141
164
|
}
|
|
142
165
|
};
|
|
143
166
|
})
|
|
144
|
-
});else
|
|
167
|
+
});else handleClickOptions(options, route, id);
|
|
145
168
|
};
|
|
146
169
|
var isLast = index === content.length - 1;
|
|
147
170
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -171,6 +194,7 @@ UTBreadcrumbs.propTypes = {
|
|
|
171
194
|
elipsis: _propTypes.string,
|
|
172
195
|
elipsisWidthEstimate: _propTypes.number,
|
|
173
196
|
onRedirect: _propTypes.func,
|
|
197
|
+
onSetAction: _propTypes.func,
|
|
174
198
|
menuProps: _propTypes.object,
|
|
175
199
|
separator: _propTypes.string
|
|
176
200
|
};
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
var
|
|
8
|
+
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
var retrieveStyle = function retrieveStyle(theme) {
|
|
11
11
|
return {
|
|
@@ -31,7 +31,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
31
31
|
},
|
|
32
32
|
baseText: {
|
|
33
33
|
textTransform: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'textTransform'], 'none'),
|
|
34
|
-
backgroundColor:
|
|
34
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
35
35
|
borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'borderRadius']),
|
|
36
36
|
boxShadow: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'boxShadow']),
|
|
37
37
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'color']),
|
|
@@ -44,7 +44,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
44
44
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseText', 'hover', 'color'])
|
|
45
45
|
},
|
|
46
46
|
'&:disabled': {
|
|
47
|
-
backgroundColor:
|
|
47
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
48
48
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledText', 'borderColor']),
|
|
49
49
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledText', 'color']),
|
|
50
50
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledText', 'padding'])
|
|
@@ -52,7 +52,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
52
52
|
},
|
|
53
53
|
baseOutlined: {
|
|
54
54
|
textTransform: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'textTransform'], 'none'),
|
|
55
|
-
backgroundColor:
|
|
55
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
56
56
|
border: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'border']),
|
|
57
57
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'borderColor']),
|
|
58
58
|
borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'borderRadius']),
|
|
@@ -67,7 +67,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
67
67
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'baseOutlined', 'hover', 'color'])
|
|
68
68
|
},
|
|
69
69
|
'&:disabled': {
|
|
70
|
-
backgroundColor:
|
|
70
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
71
71
|
border: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledOutlined', 'border']),
|
|
72
72
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledOutlined', 'borderColor']),
|
|
73
73
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'disabledOutlined', 'color']),
|
|
@@ -83,7 +83,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
83
83
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondary', 'padding'])
|
|
84
84
|
},
|
|
85
85
|
secondaryText: {
|
|
86
|
-
backgroundColor:
|
|
86
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
87
87
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryText', 'color']),
|
|
88
88
|
'&:hover': {
|
|
89
89
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryText', 'hover', 'backgroundColor'])
|
|
@@ -91,7 +91,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
91
91
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryText', 'padding'])
|
|
92
92
|
},
|
|
93
93
|
secondaryOutlined: {
|
|
94
|
-
backgroundColor:
|
|
94
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
95
95
|
border: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryOutlined', 'border']),
|
|
96
96
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryOutlined', 'borderColor']),
|
|
97
97
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'secondaryOutlined', 'color']),
|
|
@@ -109,7 +109,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
109
109
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternative', 'padding'])
|
|
110
110
|
},
|
|
111
111
|
alternativeText: {
|
|
112
|
-
backgroundColor:
|
|
112
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
113
113
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeText', 'color']),
|
|
114
114
|
'&:hover': {
|
|
115
115
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeText', 'hover', 'backgroundColor'])
|
|
@@ -117,7 +117,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
117
117
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeText', 'padding'])
|
|
118
118
|
},
|
|
119
119
|
alternativeOutlined: {
|
|
120
|
-
backgroundColor:
|
|
120
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
121
121
|
border: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeOutlined', 'border']),
|
|
122
122
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeOutlined', 'borderColor']),
|
|
123
123
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'alternativeOutlined', 'color']),
|
|
@@ -135,7 +135,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
135
135
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'gray', 'padding'])
|
|
136
136
|
},
|
|
137
137
|
grayText: {
|
|
138
|
-
backgroundColor:
|
|
138
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
139
139
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayText', 'color']),
|
|
140
140
|
'&:hover': {
|
|
141
141
|
backgroundColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayText', 'hover', 'backgroundColor'])
|
|
@@ -143,7 +143,7 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
143
143
|
padding: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayText', 'padding'])
|
|
144
144
|
},
|
|
145
145
|
grayOutlined: {
|
|
146
|
-
backgroundColor:
|
|
146
|
+
backgroundColor: _colorsModule.default.transparent,
|
|
147
147
|
border: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayOutlined', 'border']),
|
|
148
148
|
borderColor: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayOutlined', 'borderColor']),
|
|
149
149
|
color: (0, _seamlessImmutable.getIn)(theme, ['UTButton', 'grayOutlined', 'color']),
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.retrieveStyle = void 0;
|
|
7
7
|
var _seamlessImmutable = require("seamless-immutable");
|
|
8
|
-
var
|
|
8
|
+
var _colorsModule = _interopRequireDefault(require("../../scss/variables/colors.module.scss"));
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
10
|
var retrieveStyle = function retrieveStyle(theme) {
|
|
11
11
|
return {
|
|
@@ -15,10 +15,10 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
15
15
|
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'label', 'color']), " !important")
|
|
16
16
|
},
|
|
17
17
|
successLabel: {
|
|
18
|
-
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'success', 'color'],
|
|
18
|
+
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'success', 'color'], _colorsModule.default.green), " !important")
|
|
19
19
|
},
|
|
20
20
|
failureLabel: {
|
|
21
|
-
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'],
|
|
21
|
+
color: "".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'], _colorsModule.default.red), " !important")
|
|
22
22
|
},
|
|
23
23
|
iconStyle: {
|
|
24
24
|
height: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'icon', 'size'], '17px'),
|
|
@@ -26,13 +26,13 @@ var retrieveStyle = function retrieveStyle(theme) {
|
|
|
26
26
|
borderRadius: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'icon', 'borderRadius'], '50%')
|
|
27
27
|
},
|
|
28
28
|
passedIconStyle: {
|
|
29
|
-
fill: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'success', 'color'],
|
|
29
|
+
fill: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'success', 'color'], _colorsModule.default.green)
|
|
30
30
|
},
|
|
31
31
|
failedIconStyle: {
|
|
32
|
-
fill: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'],
|
|
32
|
+
fill: (0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'], _colorsModule.default.red)
|
|
33
33
|
},
|
|
34
34
|
errorsContainerStyle: {
|
|
35
|
-
borderTop: "1px solid ".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'],
|
|
35
|
+
borderTop: "1px solid ".concat((0, _seamlessImmutable.getIn)(theme, ['UTPasswordField', 'failure', 'color'], _colorsModule.default.red)),
|
|
36
36
|
marginTop: '7px'
|
|
37
37
|
},
|
|
38
38
|
warningLabel: {
|