@linzjs/step-ag-grid 2.3.0 → 2.3.1

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/index.js CHANGED
@@ -1305,12 +1305,12 @@ var ControlledMenuFr = function (_a, externalRef) {
1305
1305
  reposition,
1306
1306
  viewScroll,
1307
1307
  ]);
1308
- var clickIsWithinMenu = react.useCallback(function (ev) {
1309
- return hasParentClass("szh-menu--state-open", ev.target) ||
1310
- (closeMenuExclusionClassName && hasParentClass(closeMenuExclusionClassName, ev.target));
1308
+ var isWithinMenu = react.useCallback(function (target) {
1309
+ return hasParentClass("szh-menu--state-open", target) ||
1310
+ (closeMenuExclusionClassName && hasParentClass(closeMenuExclusionClassName, target));
1311
1311
  }, [closeMenuExclusionClassName]);
1312
1312
  var handleScreenEventForSave = react.useCallback(function (ev) {
1313
- if (!clickIsWithinMenu(ev)) {
1313
+ if (!isWithinMenu(ev.target)) {
1314
1314
  ev.preventDefault();
1315
1315
  ev.stopPropagation();
1316
1316
  // FIXME There's an issue in React17
@@ -1332,13 +1332,13 @@ var ControlledMenuFr = function (_a, externalRef) {
1332
1332
  setTimeout(function () { return (skipOpen.current = false); }, 300);
1333
1333
  }
1334
1334
  }
1335
- }, [clickIsWithinMenu, onClose, saveButtonRef, skipOpen]);
1335
+ }, [isWithinMenu, onClose, saveButtonRef, skipOpen]);
1336
1336
  var handleScreenEventForCancel = react.useCallback(function (ev) {
1337
- if (!clickIsWithinMenu(ev)) {
1337
+ if (!isWithinMenu(ev.target)) {
1338
1338
  ev.preventDefault();
1339
1339
  ev.stopPropagation();
1340
1340
  }
1341
- }, [clickIsWithinMenu]);
1341
+ }, [isWithinMenu]);
1342
1342
  react.useEffect(function () {
1343
1343
  if (isMenuOpen(state)) {
1344
1344
  var thisDocument_1 = (anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current) ? anchorRef === null || anchorRef === void 0 ? void 0 : anchorRef.current.ownerDocument : document;
@@ -1391,7 +1391,9 @@ var ControlledMenuFr = function (_a, externalRef) {
1391
1391
  }
1392
1392
  };
1393
1393
  var onBlur = function (e) {
1394
- if (isMenuOpen(state) && !e.currentTarget.contains(e.relatedTarget || document.activeElement)) {
1394
+ if (isMenuOpen(state) &&
1395
+ !e.currentTarget.contains(e.relatedTarget || document.activeElement) &&
1396
+ !isWithinMenu(e.relatedTarget)) {
1395
1397
  safeCall(onClose, { reason: CloseReason.BLUR });
1396
1398
  // If a user clicks on the menu button when a menu is open, we need to close the menu.
1397
1399
  // However, a blur event will be fired prior to the click event on menu button,
@@ -2711,8 +2713,6 @@ var useGridPopoverHook = function (props) {
2711
2713
  }); }, [props, stopEditing, propsRef]);
2712
2714
  var popoverWrapper = react.useCallback(function (children) {
2713
2715
  return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: anchorRef.current && (jsxRuntime.jsxs(ControlledMenu, __assign({ state: isOpen ? "open" : "closed", portal: true, unmountOnClose: true, anchorRef: anchorRef, saveButtonRef: saveButtonRef, menuClassName: "step-ag-grid-react-menu", onClose: function (event) {
2714
- if (event.reason === "blur")
2715
- return;
2716
2716
  triggerSave(event.reason).then();
2717
2717
  }, viewScroll: "auto", dontShrinkIfDirectionIsTop: true, className: props.className, closeMenuExclusionClassName: "ReactModal__Content" }, { children: [saving && ( // This is the overlay that prevents editing when the editor is saving
2718
2718
  jsxRuntime.jsx("div", { style: {