@linzjs/step-ag-grid 1.4.1 → 1.4.2
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 +2 -2
- package/dist/index.js.map +1 -1
- package/dist/src/components/gridForm/GridFormPopoutMenu.d.ts +1 -1
- package/dist/step-ag-grid.esm.js +2 -2
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/GridPopoverHook.tsx +2 -1
- package/src/components/gridForm/GridFormPopoutMenu.tsx +2 -2
- package/src/stories/components/GridReadOnly.stories.tsx +3 -3
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ import { ControlledMenu } from "@szhsin/react-menu";
|
|
|
5
5
|
import { GridFormProps } from "./GridCell";
|
|
6
6
|
import { hasParentClass } from "@utils/util";
|
|
7
7
|
import { GridBaseRow } from "./Grid";
|
|
8
|
+
import { isEmpty } from "lodash-es";
|
|
8
9
|
|
|
9
10
|
export const useGridPopoverHook = <RowType extends GridBaseRow>(
|
|
10
11
|
props: GridFormProps<RowType>,
|
|
@@ -84,7 +85,7 @@ export const useGridPopoverHook = <RowType extends GridBaseRow>(
|
|
|
84
85
|
{anchorRef.current && (
|
|
85
86
|
<ControlledMenu
|
|
86
87
|
state={isOpen ? "open" : "closed"}
|
|
87
|
-
portal={
|
|
88
|
+
portal={isEmpty(document.querySelectorAll(".PopoutWindowContainer"))}
|
|
88
89
|
unmountOnClose={true}
|
|
89
90
|
anchorRef={anchorRef}
|
|
90
91
|
menuClassName={"lui-menu"}
|
|
@@ -21,7 +21,7 @@ export interface MenuOption<RowType> {
|
|
|
21
21
|
label: JSX.Element | string | MenuSeparatorType;
|
|
22
22
|
action?: (selectedRows: RowType[]) => Promise<boolean>;
|
|
23
23
|
disabled?: string | boolean;
|
|
24
|
-
|
|
24
|
+
supportsMultiEdit: boolean;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/**
|
|
@@ -65,7 +65,7 @@ export const GridFormPopoutMenu = <RowType extends GridBaseRow>(props: GridFormP
|
|
|
65
65
|
const selectedRowCount = props.selectedRows.length;
|
|
66
66
|
|
|
67
67
|
const filteredOptions = options?.filter((menuOption) => {
|
|
68
|
-
return menuOption.label === MenuSeparator || selectedRowCount === 1 || menuOption.
|
|
68
|
+
return menuOption.label === MenuSeparator || selectedRowCount === 1 || menuOption.supportsMultiEdit;
|
|
69
69
|
});
|
|
70
70
|
|
|
71
71
|
const { popoverWrapper } = useGridPopoverHook(props);
|
|
@@ -98,7 +98,7 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
98
98
|
await wait(1500);
|
|
99
99
|
return true;
|
|
100
100
|
},
|
|
101
|
-
|
|
101
|
+
supportsMultiEdit: false,
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
label: "Multi-edit",
|
|
@@ -107,12 +107,12 @@ const GridReadOnlyTemplate: ComponentStory<typeof Grid> = (props: GridProps) =>
|
|
|
107
107
|
await wait(1500);
|
|
108
108
|
return true;
|
|
109
109
|
},
|
|
110
|
-
|
|
110
|
+
supportsMultiEdit: true,
|
|
111
111
|
},
|
|
112
112
|
{
|
|
113
113
|
label: "Disabled item",
|
|
114
114
|
disabled: "Disabled for test",
|
|
115
|
-
|
|
115
|
+
supportsMultiEdit: true,
|
|
116
116
|
},
|
|
117
117
|
];
|
|
118
118
|
},
|