@unbxd-ui/unbxd-react-components 0.2.135 → 0.2.136
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.
|
@@ -38,6 +38,7 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
38
38
|
isModalOpen = _useState2[0],
|
|
39
39
|
setIsModalOpen = _useState2[1];
|
|
40
40
|
var activatorProps = {};
|
|
41
|
+
var modalCloseProps = {};
|
|
41
42
|
var inlineModalClassName = "RCB-inline-modal ".concat(className);
|
|
42
43
|
var _useState3 = (0, _react.useState)(isModalOpen),
|
|
43
44
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
@@ -48,7 +49,7 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
48
49
|
var inlineModalBodyRef = (0, _react.useRef)();
|
|
49
50
|
var isFirstRun = (0, _react.useRef)(true);
|
|
50
51
|
(0, _react.useEffect)(function () {
|
|
51
|
-
setShowModalBody(isModalOpen);
|
|
52
|
+
if (isModalOpen !== undefined) setShowModalBody(isModalOpen);
|
|
52
53
|
}, [isModalOpen]);
|
|
53
54
|
var changeModalState = function changeModalState(newState) {
|
|
54
55
|
setIsModalOpen(newState);
|
|
@@ -57,6 +58,13 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
57
58
|
//e.stopPropagation();
|
|
58
59
|
changeModalState(!isModalOpen);
|
|
59
60
|
};
|
|
61
|
+
var onActivatorHover = function onActivatorHover(e) {
|
|
62
|
+
//e.stopPropagation();
|
|
63
|
+
setShowModalBody(true);
|
|
64
|
+
};
|
|
65
|
+
var onActivatorMouseOut = function onActivatorMouseOut(e) {
|
|
66
|
+
setShowModalBody(false);
|
|
67
|
+
};
|
|
60
68
|
var onBodyClick = function onBodyClick(e) {
|
|
61
69
|
var eventTarget = e.target;
|
|
62
70
|
var inlineModalNode = inlineModalRef.current;
|
|
@@ -107,8 +115,13 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
107
115
|
onClick: onActivatorClick
|
|
108
116
|
};
|
|
109
117
|
} else if (activatorAction === "hover") {
|
|
110
|
-
|
|
111
|
-
|
|
118
|
+
activatorProps = {
|
|
119
|
+
onMouseOver: onActivatorHover
|
|
120
|
+
};
|
|
121
|
+
modalCloseProps = {
|
|
122
|
+
onMouseLeave: onActivatorMouseOut
|
|
123
|
+
};
|
|
124
|
+
// setShowModalBody(true);
|
|
112
125
|
}
|
|
113
126
|
|
|
114
127
|
/* add methods that can be accessed via this component's ref */
|
|
@@ -119,10 +132,10 @@ var InlineModal = function InlineModal(props, ref) {
|
|
|
119
132
|
}
|
|
120
133
|
};
|
|
121
134
|
});
|
|
122
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
135
|
+
return /*#__PURE__*/_react["default"].createElement("div", _extends({
|
|
123
136
|
className: inlineModalClassName,
|
|
124
137
|
ref: inlineModalRef
|
|
125
|
-
}, /*#__PURE__*/_react["default"].createElement("div", _extends({}, activatorProps, {
|
|
138
|
+
}, modalCloseProps), /*#__PURE__*/_react["default"].createElement("div", _extends({}, activatorProps, {
|
|
126
139
|
className: "RCB-inline-modal-btn ".concat(activatorClassName)
|
|
127
140
|
}), children[0]), showModalBody && /*#__PURE__*/_react["default"].createElement("div", {
|
|
128
141
|
className: "RCB-inline-modal-body RCB-align-".concat(halign),
|