@linzjs/step-ag-grid 2.2.0 → 2.2.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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@linzjs/step-ag-grid",
3
3
  "repository": "github:linz/step-ag-grid.git",
4
4
  "license": "MIT",
5
- "version": "2.2.0",
5
+ "version": "2.2.1",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -49,6 +49,7 @@ export const useGridPopoverHook = <RowType extends GridBaseRow>(props: GridPopov
49
49
  viewScroll={"auto"}
50
50
  dontShrinkIfDirectionIsTop={true}
51
51
  className={props.className}
52
+ closeMenuExclusionClassName={"ReactModal__Content"}
52
53
  >
53
54
  {saving && ( // This is the overlay that prevents editing when the editor is saving
54
55
  <div
package/src/index.ts CHANGED
@@ -27,6 +27,9 @@ export { GridPopoverEditDropDown } from "./components/gridPopoverEdit/GridPopove
27
27
  export { GridPopoverMessage } from "./components/gridPopoverEdit/GridPopoverMessage";
28
28
  export { GridPopoverTextArea } from "./components/gridPopoverEdit/GridPopoverTextArea";
29
29
  export { GridPopoverTextInput } from "./components/gridPopoverEdit/GridPopoverTextInput";
30
+ export * from "./components/gridForm/GridFormDropDown";
31
+ export * from "./components/gridForm/GridFormMultiSelect";
32
+ export * from "./components/gridForm/GridFormPopoutMenu";
30
33
 
31
34
  export { GridHeaderSelect } from "./components/gridHeader/GridHeaderSelect";
32
35
 
@@ -40,6 +40,7 @@ export const ControlledMenuFr = (
40
40
  onItemClick,
41
41
  onClose,
42
42
  saveButtonRef,
43
+ closeMenuExclusionClassName,
43
44
  ...restProps
44
45
  }: ControlledMenuProps & { saveButtonRef?: MutableRefObject<HTMLButtonElement | null> },
45
46
  externalRef: ForwardedRef<HTMLUListElement>,
@@ -75,14 +76,16 @@ export const ControlledMenuFr = (
75
76
  ],
76
77
  );
77
78
 
78
- const clickIsWithinMenu = useCallback((ev: MouseEvent) => {
79
- return hasParentClass("szh-menu--state-open", ev.target as Node);
80
- }, []);
79
+ const clickIsWithinMenu = useCallback(
80
+ (ev: MouseEvent) =>
81
+ hasParentClass("szh-menu--state-open", ev.target as Node) ||
82
+ (closeMenuExclusionClassName && hasParentClass(closeMenuExclusionClassName, ev.target as Node)),
83
+ [closeMenuExclusionClassName],
84
+ );
81
85
 
82
86
  const handleScreenEventForSave = useCallback(
83
87
  (ev: MouseEvent) => {
84
88
  if (!clickIsWithinMenu(ev)) {
85
- //!ev.currentTarget.contains(ev.relatedTarget || document.activeElement)) {
86
89
  ev.preventDefault();
87
90
  ev.stopPropagation();
88
91
  // FIXME There's an issue in React17
@@ -439,4 +439,9 @@ export interface ControlledMenuProps extends RootMenuProps, ExtraMenuProps {
439
439
  * Event fired when menu is about to close.
440
440
  */
441
441
  onClose?: EventHandler<MenuCloseEvent>;
442
+
443
+ /**
444
+ * When clicking outside the menu to close, anything with this class will not cause a close.
445
+ */
446
+ closeMenuExclusionClassName?: string;
442
447
  }