@unbxd-ui/unbxd-react-components 0.2.130 → 0.2.132
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/components/Modal/Modal.js +6 -3
- package/core/dataLoader.js +2 -2
- package/package.json +1 -1
|
@@ -56,7 +56,8 @@ ModalContent.propTypes = {
|
|
|
56
56
|
|
|
57
57
|
/** Displays a full screen modal */
|
|
58
58
|
var Modal = function Modal(props, ref) {
|
|
59
|
-
var isOpen = props.isOpen,
|
|
59
|
+
var _props$isOpen = props.isOpen,
|
|
60
|
+
isOpen = _props$isOpen === void 0 ? null : _props$isOpen,
|
|
60
61
|
onClose = props.onClose,
|
|
61
62
|
_props$isConditionalH = props.isConditionalHideEnabled,
|
|
62
63
|
isConditionalHideEnabled = _props$isConditionalH === void 0 ? false : _props$isConditionalH,
|
|
@@ -78,7 +79,9 @@ var Modal = function Modal(props, ref) {
|
|
|
78
79
|
}
|
|
79
80
|
};
|
|
80
81
|
(0, _react.useEffect)(function () {
|
|
81
|
-
|
|
82
|
+
if (isOpen !== null) {
|
|
83
|
+
setIsModalOpen(isOpen);
|
|
84
|
+
}
|
|
82
85
|
}, [isOpen]);
|
|
83
86
|
|
|
84
87
|
/* add methods that can be accessed via this component's ref */
|
|
@@ -114,7 +117,7 @@ Modal.propTypes = {
|
|
|
114
117
|
Modal.defaultProps = {
|
|
115
118
|
className: "",
|
|
116
119
|
title: "",
|
|
117
|
-
isOpen:
|
|
120
|
+
isOpen: null,
|
|
118
121
|
showClose: true,
|
|
119
122
|
showHeader: true,
|
|
120
123
|
isConditionalHideEnabled: false
|
package/core/dataLoader.js
CHANGED
|
@@ -152,7 +152,7 @@ var DataLoader = /*#__PURE__*/function () {
|
|
|
152
152
|
var requestUrl = typeof url === "function" ? url(urlParams) : url;
|
|
153
153
|
var reqMethod = method.toLowerCase();
|
|
154
154
|
var requestMetadata = {
|
|
155
|
-
method: reqMethod === "form_post" || reqMethod === "upload" ? "post" : method,
|
|
155
|
+
method: reqMethod === "form_post" || reqMethod === "upload" ? "post" : reqMethod === "upload_put" ? "put" : method,
|
|
156
156
|
headers: _objectSpread(_objectSpread({}, this._commonHeaders), headers),
|
|
157
157
|
signal: this.abortController[requestId] ? this.abortController[requestId].signal : null
|
|
158
158
|
};
|
|
@@ -167,7 +167,7 @@ var DataLoader = /*#__PURE__*/function () {
|
|
|
167
167
|
requestUrl = "".concat(requestUrl, "?").concat(_utils["default"].getQueryParams(finalRequestParams));
|
|
168
168
|
} else if (["post", "delete", "put", "patch"].indexOf(reqMethod) > -1) {
|
|
169
169
|
requestMetadata.body = JSON.stringify(finalRequestParams);
|
|
170
|
-
} else if (reqMethod === "form_post" || reqMethod === "upload") {
|
|
170
|
+
} else if (reqMethod === "form_post" || reqMethod === "upload" || reqMethod === "upload_put") {
|
|
171
171
|
var formData = new FormData();
|
|
172
172
|
for (var key in finalRequestParams) {
|
|
173
173
|
formData.append(key, finalRequestParams[key]);
|