@widergy/energy-ui 3.49.7 → 3.49.8
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
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [3.49.8](https://github.com/widergy/energy-ui/compare/v3.49.7...v3.49.8) (2024-12-18)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* [UG-2420] workflows forms fixes ([#552](https://github.com/widergy/energy-ui/issues/552)) ([f0fefd1](https://github.com/widergy/energy-ui/commit/f0fefd1e2f3b1b82b8bd0fae78642499fbcb70f9))
|
|
7
|
+
|
|
1
8
|
## [3.49.7](https://github.com/widergy/energy-ui/compare/v3.49.6...v3.49.7) (2024-12-17)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -55,24 +55,37 @@ const UTWorkflowContainer = _ref => {
|
|
|
55
55
|
(0, _react.useEffect)(() => () => onExit && onExit(), []);
|
|
56
56
|
const classes = (0, _react.useMemo)(() => (0, _classesUtils.mergeClasses)(themeClasses, classNames), [classNames]);
|
|
57
57
|
const {
|
|
58
|
-
isMobileOrTablet
|
|
58
|
+
isMobileOrTablet,
|
|
59
|
+
isMobileSize
|
|
59
60
|
} = (0, _useScreenSize.useScreenSize)();
|
|
60
61
|
const isBackButtonHidden = backButton === null || backButton === void 0 ? void 0 : backButton.isHidden;
|
|
61
62
|
const isNextButtonHidden = nextButton === null || nextButton === void 0 ? void 0 : nextButton.isHidden;
|
|
62
63
|
const isLastStep = stepsCount && stepsCount === currentStep;
|
|
63
64
|
const isNavHidden = !!isLastStep && isBackButtonHidden && isNextButtonHidden;
|
|
64
65
|
(0, _react.useEffect)(() => {
|
|
66
|
+
const processFormElements = callback => {
|
|
67
|
+
const currentFormElements = document.querySelectorAll(_constants.FORMS_QUERY_SELECTOR);
|
|
68
|
+
if (!(0, _isEmpty.default)(currentFormElements)) {
|
|
69
|
+
currentFormElements.forEach(callback);
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
const removeStylesFromForms = () => {
|
|
73
|
+
processFormElements(form => {
|
|
74
|
+
var _form$classList;
|
|
75
|
+
form === null || form === void 0 || (_form$classList = form.classList) === null || _form$classList === void 0 || _form$classList.remove(_stylesModule.default.formContainer);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
65
78
|
const applyStylesToForms = () => {
|
|
66
|
-
|
|
67
|
-
if (!(0, _isEmpty.default)(formComponents)) formComponents.forEach(form => {
|
|
79
|
+
processFormElements(form => {
|
|
68
80
|
const childrenIsNotEmpty = !(0, _isEmpty.default)(form === null || form === void 0 ? void 0 : form.children);
|
|
69
81
|
const hasInputs = !(0, _isEmpty.default)(form.querySelectorAll('input'));
|
|
70
82
|
if (childrenIsNotEmpty && hasInputs) {
|
|
71
|
-
var _form$
|
|
72
|
-
form === null || form === void 0 || (_form$
|
|
83
|
+
var _form$classList2;
|
|
84
|
+
form === null || form === void 0 || (_form$classList2 = form.classList) === null || _form$classList2 === void 0 || _form$classList2.add(_stylesModule.default.formContainer);
|
|
73
85
|
}
|
|
74
86
|
});
|
|
75
87
|
};
|
|
88
|
+
if (isMobileSize) return removeStylesFromForms();
|
|
76
89
|
const observer = new MutationObserver(() => applyStylesToForms());
|
|
77
90
|
observer.observe(document.body, {
|
|
78
91
|
childList: true,
|
|
@@ -80,10 +93,10 @@ const UTWorkflowContainer = _ref => {
|
|
|
80
93
|
});
|
|
81
94
|
applyStylesToForms();
|
|
82
95
|
return () => {
|
|
83
|
-
|
|
96
|
+
removeStylesFromForms();
|
|
84
97
|
observer.disconnect();
|
|
85
98
|
};
|
|
86
|
-
}, [currentStep, currentStage]);
|
|
99
|
+
}, [currentStep, currentStage, isMobileSize]);
|
|
87
100
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
88
101
|
className: "".concat(_stylesModule.default.container, " ").concat(classes.container)
|
|
89
102
|
}, /*#__PURE__*/_react.default.createElement("div", {
|