@linzjs/step-ag-grid 2.4.5 → 2.4.6
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 +14 -10
- package/dist/index.js.map +1 -1
- package/dist/src/components/gridForm/{GridFormPopoutMenu.d.ts → GridFormPopoverMenu.d.ts} +1 -1
- package/dist/src/components/gridPopoverEdit/GridPopoverMenu.d.ts +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/react-menu3/components/Menu.d.ts +2 -2
- package/dist/step-ag-grid.esm.js +14 -10
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/gridForm/{GridFormPopoutMenu.tsx → GridFormPopoverMenu.tsx} +1 -1
- package/src/components/gridPopoverEdit/GridPopoverMenu.tsx +2 -2
- package/src/contexts/GridContextProvider.tsx +1 -6
- package/src/index.ts +1 -1
- package/src/react-menu3/components/ControlledMenu.tsx +1 -1
- package/src/react-menu3/components/Menu.tsx +2 -2
- package/src/react-menu3/components/MenuButton.tsx +1 -1
- package/src/react-menu3/components/MenuGroup.tsx +1 -2
- package/src/react-menu3/components/MenuItem.tsx +8 -3
- package/src/react-menu3/components/SubMenu.tsx +0 -1
- package/src/react-menu3/hooks/useBEM.ts +1 -1
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.4.
|
|
5
|
+
"version": "2.4.6",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"aggrid",
|
|
8
8
|
"ag-grid",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"css": "sass ./src/styles/index.scss:dist/index.css --no-source-map",
|
|
54
54
|
"test": "react-scripts test",
|
|
55
55
|
"eject": "react-scripts eject",
|
|
56
|
-
"lint": "eslint ./src --ext .js,.ts,.tsx --fix --cache",
|
|
56
|
+
"lint": "eslint ./src --ext .js,.ts,.tsx --fix --cache --ignore-path .gitignore",
|
|
57
57
|
"storybook": "start-storybook -p 6006",
|
|
58
58
|
"build-storybook": "build-storybook",
|
|
59
59
|
"deploy-storybook": "npx --yes -p @storybook/storybook-deployer storybook-to-ghpages",
|
|
@@ -29,7 +29,7 @@ export interface MenuOption<RowType> {
|
|
|
29
29
|
* NOTE: If the popout menu doesn't appear on single click when also selecting row it's because
|
|
30
30
|
* you need a useMemo around your columnDefs
|
|
31
31
|
*/
|
|
32
|
-
export const
|
|
32
|
+
export const GridFormPopoverMenu = <RowType extends GridBaseRow>(_props: GridFormPopoutMenuProps<RowType>) => {
|
|
33
33
|
const props = _props as GridFormPopoutMenuProps<RowType> & CellParams<RowType>;
|
|
34
34
|
const { updatingCells } = useContext(GridContext);
|
|
35
35
|
const optionsInitialising = useRef(false);
|
|
@@ -3,7 +3,7 @@ import "./GridPopoverMenu.scss";
|
|
|
3
3
|
import { GenericMultiEditCellClass } from "../GenericCellClass";
|
|
4
4
|
import { GridBaseRow } from "../Grid";
|
|
5
5
|
import { ColDefT, GenericCellEditorProps, GridCell } from "../GridCell";
|
|
6
|
-
import {
|
|
6
|
+
import { GridFormPopoverMenu, GridFormPopoutMenuProps } from "../gridForm/GridFormPopoverMenu";
|
|
7
7
|
import { GridRenderPopoutMenuCell } from "../gridRender/GridRenderPopoutMenuCell";
|
|
8
8
|
import { GenericCellColDef } from "../gridRender/GridRenderGenericCell";
|
|
9
9
|
|
|
@@ -28,7 +28,7 @@ export const GridPopoverMenu = <RowType extends GridBaseRow>(
|
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
|
-
editor:
|
|
31
|
+
editor: GridFormPopoverMenu,
|
|
32
32
|
...custom,
|
|
33
33
|
},
|
|
34
34
|
);
|
|
@@ -238,12 +238,7 @@ export const GridContextProvider = (props: GridContextProps): ReactElement => {
|
|
|
238
238
|
|
|
239
239
|
return await gridApiOp(async (gridApi) => {
|
|
240
240
|
const selectedRows = props.selectedRows;
|
|
241
|
-
|
|
242
|
-
/*if (!props.multiEdit) {
|
|
243
|
-
// You can't use data as it could be an orphaned reference due to updates
|
|
244
|
-
selectedRows = selectedRows.filter((row) => row.id === props.data.id);
|
|
245
|
-
}
|
|
246
|
-
*/
|
|
241
|
+
|
|
247
242
|
let ok = false;
|
|
248
243
|
await modifyUpdating(
|
|
249
244
|
props.field ?? "",
|
package/src/index.ts
CHANGED
|
@@ -30,7 +30,7 @@ export { GridPopoverTextInput } from "./components/gridPopoverEdit/GridPopoverTe
|
|
|
30
30
|
export { GridFormSubComponentTextInput } from "./components/gridForm/GridFormSubComponentTextInput";
|
|
31
31
|
export * from "./components/gridForm/GridFormDropDown";
|
|
32
32
|
export * from "./components/gridForm/GridFormMultiSelect";
|
|
33
|
-
export * from "./components/gridForm/
|
|
33
|
+
export * from "./components/gridForm/GridFormPopoverMenu";
|
|
34
34
|
|
|
35
35
|
export { GridHeaderSelect } from "./components/gridHeader/GridHeaderSelect";
|
|
36
36
|
|
|
@@ -88,7 +88,7 @@ export const ControlledMenuFr = (
|
|
|
88
88
|
if (!isWithinMenu(ev.target)) {
|
|
89
89
|
ev.preventDefault();
|
|
90
90
|
ev.stopPropagation();
|
|
91
|
-
//
|
|
91
|
+
// Note: There's an issue in React17
|
|
92
92
|
// the cell doesn't refresh during update if save is invoked from a native event
|
|
93
93
|
// This doesn't happen in React18
|
|
94
94
|
// To work around it, I invoke the save by clicking on a passed in invisible button ref
|
|
@@ -31,7 +31,7 @@ export interface MenuProps extends RootMenuProps, UncontrolledMenuProps {
|
|
|
31
31
|
|
|
32
32
|
export function MenuFr(
|
|
33
33
|
{ "aria-label": ariaLabel, menuButton, instanceRef, onMenuChange, ...restProps }: MenuProps,
|
|
34
|
-
externalRef: ForwardedRef<
|
|
34
|
+
externalRef: ForwardedRef<ReactElement>,
|
|
35
35
|
) {
|
|
36
36
|
const [stateProps, toggleMenu, openMenu] = useMenuStateAndFocus(restProps);
|
|
37
37
|
const isOpen = isMenuOpen(stateProps.state);
|
|
@@ -69,7 +69,7 @@ export function MenuFr(
|
|
|
69
69
|
e.preventDefault();
|
|
70
70
|
};
|
|
71
71
|
|
|
72
|
-
//
|
|
72
|
+
// Too many mixed types here to figure out what to pick for button. Bad code.
|
|
73
73
|
const button: any = safeCall(menuButton, { open: isOpen });
|
|
74
74
|
if (!button || !button.type) throw new Error("Menu requires a menuButton prop.");
|
|
75
75
|
|
|
@@ -7,7 +7,7 @@ export interface MenuButtonProps extends BaseProps<MenuButtonModifiers> {
|
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
children?: ReactNode;
|
|
9
9
|
|
|
10
|
-
//
|
|
10
|
+
// Seems to be an internal thing, wasn't in original code
|
|
11
11
|
isOpen?: boolean;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -24,7 +24,6 @@ export const MenuGroupFr = (
|
|
|
24
24
|
useLayoutEffect(() => {
|
|
25
25
|
let maxHeight;
|
|
26
26
|
if (takeOverflow && overflowAmt != null && overflowAmt >= 0 && ref.current) {
|
|
27
|
-
// FIXME Matt added && ref.current
|
|
28
27
|
maxHeight = ref.current.getBoundingClientRect().height - overflowAmt;
|
|
29
28
|
if (maxHeight < 0) maxHeight = 0;
|
|
30
29
|
}
|
|
@@ -38,7 +37,7 @@ export const MenuGroupFr = (
|
|
|
38
37
|
return (
|
|
39
38
|
<div
|
|
40
39
|
{...restProps}
|
|
41
|
-
ref={useCombinedRef(externalRef, ref)}
|
|
40
|
+
ref={useCombinedRef(externalRef, ref)}
|
|
42
41
|
className={useBEM({ block: menuClass, element: menuGroupClass, className })}
|
|
43
42
|
style={{ ...style, ...overflowStyle }}
|
|
44
43
|
/>
|
|
@@ -89,11 +89,16 @@ const MenuItemFr = ({
|
|
|
89
89
|
const isAnchor = !!href && !isDisabled && !isRadio && !isCheckBox;
|
|
90
90
|
const isChecked = isRadio ? radioGroup.value === value : isCheckBox ? !!checked : false;
|
|
91
91
|
|
|
92
|
-
//
|
|
92
|
+
// handle click seems to be a combination of multiple event types, bad code.
|
|
93
93
|
const handleClick = (e: any) => {
|
|
94
94
|
if (isDisabled) {
|
|
95
|
-
e.
|
|
96
|
-
|
|
95
|
+
if (e.syntheticEvent) {
|
|
96
|
+
e.syntheticEvent.stopPropagation();
|
|
97
|
+
e.syntheticEvent.preventDefault();
|
|
98
|
+
} else {
|
|
99
|
+
e.stopPropagation();
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
}
|
|
97
102
|
return;
|
|
98
103
|
}
|
|
99
104
|
|
|
@@ -175,7 +175,6 @@ export const SubMenuFr = ({
|
|
|
175
175
|
const { isParentOpen, isSubmenuOpen, setOpenSubmenuCount, dispatch, updateItems } = useContext(MenuListItemContext);
|
|
176
176
|
const isPortal = parentOverflow !== "visible";
|
|
177
177
|
|
|
178
|
-
// FIXME Matt no idea what's going on here
|
|
179
178
|
const [stateProps, toggleMenu, _openMenu] = useMenuStateAndFocus(settings);
|
|
180
179
|
|
|
181
180
|
const { state } = stateProps;
|
|
@@ -7,7 +7,7 @@ interface useBemProps {
|
|
|
7
7
|
block: string;
|
|
8
8
|
element?: string;
|
|
9
9
|
modifiers?: useBemModifiers;
|
|
10
|
-
className?: ClassNameProp<any>;
|
|
10
|
+
className?: ClassNameProp<any>;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
// Generate className following BEM methodology: http://getbem.com/naming/
|