@linzjs/step-ag-grid 7.6.1 → 7.6.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/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": "7.6.1",
5
+ "version": "7.6.2",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -68,7 +68,7 @@ export const GridCell = <RowType extends GridBaseRow, Props extends CellEditorCo
68
68
  sortable: !!(props?.field || props?.valueGetter),
69
69
  resizable: true,
70
70
  ...(custom?.editor && {
71
- cellClassRules: GridCellMultiSelectClassRules,
71
+ cellClassRules: custom.multiEdit ? GridCellMultiSelectClassRules : undefined,
72
72
  editable: props.editable ?? true,
73
73
  cellEditor: GenericCellEditorComponentWrapper(custom),
74
74
  }),
@@ -251,7 +251,10 @@ export const GridContextProvider = (props: GridContextProps): ReactElement => {
251
251
  async () => {
252
252
  // Need to refresh to get spinners to work on all rows
253
253
  gridApi.refreshCells({ rowNodes: props.selectedRows as RowNode[], force: true });
254
- ok = await fnUpdate(selectedRows);
254
+ ok = await fnUpdate(selectedRows).catch((ex) => {
255
+ console.error("Exception during modifyUpdating", ex);
256
+ return false;
257
+ });
255
258
  },
256
259
  );
257
260
 
@@ -31,9 +31,7 @@ export const GridPopoverContextProvider = ({ props, children }: GridPopoverConte
31
31
  async (saveFn: (selectedRows: any[]) => Promise<boolean>, tabDirection: 1 | 0 | -1): Promise<boolean> => {
32
32
  if (hasSaved.current) return true;
33
33
  hasSaved.current = true;
34
- const r = saving ? false : await updatingCells({ selectedRows, field }, saveFn, setSaving, tabDirection);
35
- //if (r) stopEditing();
36
- return r;
34
+ return saving ? false : await updatingCells({ selectedRows, field }, saveFn, setSaving, tabDirection);
37
35
  },
38
36
  [field, saving, selectedRows, updatingCells],
39
37
  );
@@ -75,8 +75,6 @@
75
75
  }
76
76
 
77
77
  .ag-cell.ag-cell-inline-editing {
78
- padding-left: 9px;
79
- padding-right: 9px;
80
78
  bottom: 0;
81
79
  }
82
80
 
@@ -84,9 +82,11 @@
84
82
  word-break: break-word;
85
83
  }
86
84
 
87
- .ag-cell-popup-editing,
88
- .ag-selected-for-edit,
85
+ .ag-cell.ag-cell-popup-editing,
86
+ .ag-cell.ag-selected-for-edit,
89
87
  .ag-cell-inline-editing {
88
+ padding-left: 9px;
89
+ padding-right: 9px;
90
90
  background: rgb(72 160 244 / 20%);
91
91
  // These are important, it needs to override ag-grid to work
92
92
  border: 3px solid #48a0f4 !important;
@@ -1,9 +1,16 @@
1
- import { useRef } from "react";
1
+ import { useEffect, useRef } from "react";
2
2
 
3
3
  export const useDeferredPromise = <T>() => {
4
4
  const promiseResolve = useRef<((value: T | PromiseLike<T>) => void) | undefined>();
5
5
  const promiseReject = useRef<() => void>();
6
6
 
7
+ // End promise on unload
8
+ useEffect(() => {
9
+ return () => {
10
+ promiseReject.current && promiseReject.current();
11
+ };
12
+ }, []);
13
+
7
14
  return {
8
15
  invoke: () =>
9
16
  new Promise<T>((resolve, reject) => {