magneto365.ui 2.65.2 → 2.65.4
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/dist/cjs/index.js +43 -19
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +43 -19
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -2692,6 +2692,8 @@ var DrawerPortal = function (_a) {
|
|
|
2692
2692
|
var portalNode = React.useRef(null);
|
|
2693
2693
|
var _b = React.useState(false), mounted = _b[0], setMounted = _b[1];
|
|
2694
2694
|
React.useEffect(function () {
|
|
2695
|
+
if (!document)
|
|
2696
|
+
return;
|
|
2695
2697
|
portalNode.current = document.createElement('div');
|
|
2696
2698
|
portalNode.current.classList.add('magneto-ui-drawer');
|
|
2697
2699
|
document.body.appendChild(portalNode.current);
|
|
@@ -4535,6 +4537,26 @@ var MobileSearchbar = Component$1x;
|
|
|
4535
4537
|
|
|
4536
4538
|
var styles$1p = {"magneto-ui-modal":"mg_modal_magneto-ui-modal_1vun3","magneto-ui-modal__close-btn":"mg_modal_magneto-ui-modal_close-btn_1vun3","magneto-ui-modal__title":"mg_modal_magneto-ui-modal_title_1vun3","magneto-ui-modal__description":"mg_modal_magneto-ui-modal_description_1vun3","magneto-ui-modal__children-container":"mg_modal_magneto-ui-modal_children-container_1vun3","magneto-ui-background-modal":"mg_modal_magneto-ui-background-modal_1vun3","fadeIn":"mg_modal_fadeIn_1vun3"};
|
|
4537
4539
|
|
|
4540
|
+
var ModalPortal = function (_a) {
|
|
4541
|
+
var children = _a.children;
|
|
4542
|
+
var portalNode = React.useRef(null);
|
|
4543
|
+
var _b = React.useState(false), mounted = _b[0], setMounted = _b[1];
|
|
4544
|
+
React.useEffect(function () {
|
|
4545
|
+
if (!document)
|
|
4546
|
+
return;
|
|
4547
|
+
portalNode.current = document.createElement('div');
|
|
4548
|
+
portalNode.current.classList.add('modal-ui-drawer');
|
|
4549
|
+
document.body.appendChild(portalNode.current);
|
|
4550
|
+
setMounted(true);
|
|
4551
|
+
return function () {
|
|
4552
|
+
if (portalNode.current) {
|
|
4553
|
+
document.body.removeChild(portalNode.current);
|
|
4554
|
+
}
|
|
4555
|
+
};
|
|
4556
|
+
}, []);
|
|
4557
|
+
return mounted && portalNode.current ? ReactDOM__default["default"].createPortal(children, portalNode.current) : null;
|
|
4558
|
+
};
|
|
4559
|
+
|
|
4538
4560
|
var Modal = function (_a) {
|
|
4539
4561
|
var onClose = _a.onClose, isOpen = _a.isOpen, children = _a.children, title = _a.title, description = _a.description, _b = _a.className, className = _b === void 0 ? '' : _b, _c = _a.blockBackgroundClose, blockBackgroundClose = _c === void 0 ? false : _c;
|
|
4540
4562
|
React.useEffect(function () {
|
|
@@ -4545,7 +4567,7 @@ var Modal = function (_a) {
|
|
|
4545
4567
|
}, [isOpen]);
|
|
4546
4568
|
if (!isOpen)
|
|
4547
4569
|
return null;
|
|
4548
|
-
return (React__default["default"].createElement(
|
|
4570
|
+
return (React__default["default"].createElement(ModalPortal, null,
|
|
4549
4571
|
React__default["default"].createElement("div", { className: "".concat(styles$1p["".concat(classMUI, "-modal")], " ").concat(className) },
|
|
4550
4572
|
title ? React__default["default"].createElement("h2", { className: "".concat(styles$1p["".concat(classMUI, "-modal__title")]) }, title) : null,
|
|
4551
4573
|
description ? React__default["default"].createElement("p", { className: "".concat(styles$1p["".concat(classMUI, "-modal__description")]) }, description) : null,
|
|
@@ -5321,21 +5343,6 @@ var MegaMenuEmpty = function (_a) {
|
|
|
5321
5343
|
React__default["default"].createElement("img", { className: style$y['mega-menu-empty__image'], src: staticMessages[imageData], height: 170 })));
|
|
5322
5344
|
};
|
|
5323
5345
|
|
|
5324
|
-
var ModalPortal = function (_a) {
|
|
5325
|
-
var children = _a.children;
|
|
5326
|
-
var portalNode = React.useRef(null);
|
|
5327
|
-
var _b = React.useState(false), mounted = _b[0], setMounted = _b[1];
|
|
5328
|
-
React.useEffect(function () {
|
|
5329
|
-
if (!document)
|
|
5330
|
-
return;
|
|
5331
|
-
portalNode.current = document.createElement('div');
|
|
5332
|
-
portalNode.current.classList.add('modal-ui-drawer');
|
|
5333
|
-
document.body.appendChild(portalNode.current);
|
|
5334
|
-
setMounted(true);
|
|
5335
|
-
}, []);
|
|
5336
|
-
return mounted && portalNode.current ? ReactDOM__default["default"].createPortal(children, portalNode.current) : null;
|
|
5337
|
-
};
|
|
5338
|
-
|
|
5339
5346
|
var styles$10 = {"notification":"mg_notification_notification_ylzl6","top-left":"mg_notification_top-left_ylzl6","top-right":"mg_notification_top-right_ylzl6","bottom-left":"mg_notification_bottom-left_ylzl6","bottom-right":"mg_notification_bottom-right_ylzl6","notification__content":"mg_notification_notification_content_ylzl6","notification__message":"mg_notification_notification_message_ylzl6","notification__close-btn":"mg_notification_notification_close-btn_ylzl6"};
|
|
5340
5347
|
|
|
5341
5348
|
var Notification = function (_a) {
|
|
@@ -7763,8 +7770,25 @@ var useSelect2 = function (_a) {
|
|
|
7763
7770
|
}
|
|
7764
7771
|
}, [searchValue, setTerm]);
|
|
7765
7772
|
React.useEffect(function () {
|
|
7766
|
-
if (!currentFields
|
|
7767
|
-
|
|
7773
|
+
if (!currentFields) {
|
|
7774
|
+
if (valueSelected.length !== 0) {
|
|
7775
|
+
setValueSelected([]);
|
|
7776
|
+
}
|
|
7777
|
+
return;
|
|
7778
|
+
}
|
|
7779
|
+
if (!Array.isArray(currentFields)) {
|
|
7780
|
+
if ('id' in currentFields && 'name' in currentFields) {
|
|
7781
|
+
var newValue = [currentFields];
|
|
7782
|
+
if (JSON.stringify(valueSelected) !== JSON.stringify(newValue)) {
|
|
7783
|
+
setValueSelected(newValue);
|
|
7784
|
+
}
|
|
7785
|
+
}
|
|
7786
|
+
return;
|
|
7787
|
+
}
|
|
7788
|
+
if (currentFields.length === 0) {
|
|
7789
|
+
if (valueSelected.length !== 0) {
|
|
7790
|
+
setValueSelected([]);
|
|
7791
|
+
}
|
|
7768
7792
|
return;
|
|
7769
7793
|
}
|
|
7770
7794
|
setValueSelected(function (prev) {
|
|
@@ -7773,7 +7797,7 @@ var useSelect2 = function (_a) {
|
|
|
7773
7797
|
}
|
|
7774
7798
|
return currentFields;
|
|
7775
7799
|
});
|
|
7776
|
-
}, [currentFields]);
|
|
7800
|
+
}, [currentFields, valueSelected]);
|
|
7777
7801
|
React.useEffect(function () {
|
|
7778
7802
|
if (limitSelections && valueSelected.length >= limitSelections) {
|
|
7779
7803
|
setDisableList(true);
|