@linzjs/step-ag-grid 30.1.0 → 30.2.0

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": "30.1.0",
5
+ "version": "30.2.0",
6
6
  "keywords": [
7
7
  "aggrid",
8
8
  "ag-grid",
@@ -2,14 +2,21 @@ import clsx from 'clsx';
2
2
 
3
3
  import { GenericCellEditorProps, GridCell } from '../GridCell';
4
4
  import { GridFormDropDown, GridFormDropDownProps } from '../gridForm/GridFormDropDown';
5
+ import { GridIcon } from '../GridIcon';
5
6
  import { GenericCellColDef } from '../gridRender/GridRenderGenericCell';
6
7
  import { ColDefT, GridBaseRow } from '../types';
7
8
 
8
9
  export const GridPopoverEditDropDown = <TData extends GridBaseRow, TValue = any, TOptionValue = any>(
9
10
  colDef: GenericCellColDef<TData, TValue>,
10
11
  props: GenericCellEditorProps<GridFormDropDownProps<TData, TOptionValue>>,
11
- ): ColDefT<TData, TValue> =>
12
- GridCell<TData, TValue, GridFormDropDownProps<TData, TOptionValue>>(colDef, {
12
+ ): ColDefT<TData, TValue> => {
13
+ colDef.cellRendererParams = {
14
+ rightHoverElement: (
15
+ <GridIcon icon={'ic_arrow_drop_down'} title={''} className={'GridCell-editableIcon GridCell-dropDownIcon'} />
16
+ ),
17
+ ...colDef.cellRendererParams,
18
+ };
19
+ return GridCell<TData, TValue, GridFormDropDownProps<TData, TOptionValue>>(colDef, {
13
20
  editor: GridFormDropDown,
14
21
  ...props,
15
22
  editorParams: {
@@ -24,3 +31,4 @@ export const GridPopoverEditDropDown = <TData extends GridBaseRow, TValue = any,
24
31
  ),
25
32
  },
26
33
  });
34
+ };
@@ -41,9 +41,20 @@ export const GridContextProvider = <TData extends GridBaseRow>(props: PropsWithC
41
41
  const enableMultilineBulkEditRef = useRef(false);
42
42
  const idsBeforeUpdate = useRef<TData['id'][]>([]);
43
43
  const prePopupFocusedCell = useRef<CellPosition>();
44
- const [externallySelectedItemsAreInSync, setExternallySelectedItemsAreInSync] = useState(false);
44
+ const [externallySelectedItemsAreInSync, _setExternallySelectedItemsAreInSync] = useState(false);
45
45
  const externalFilters = useRef<GridFilterExternal<TData>[]>([]);
46
46
 
47
+ // waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
48
+ const externallySelectedItemsAreInSyncRef = useRef(false);
49
+
50
+ const setExternallySelectedItemsAreInSync = useCallback(
51
+ (cond: boolean) => {
52
+ _setExternallySelectedItemsAreInSync(cond);
53
+ externallySelectedItemsAreInSyncRef.current = cond;
54
+ },
55
+ [_setExternallySelectedItemsAreInSync],
56
+ );
57
+
47
58
  const setQuickFilter = useCallback(
48
59
  (filter: string) => {
49
60
  // If we don't clear the focused cell focus switches back to grid when typing in the quick filter input
@@ -539,12 +550,6 @@ export const GridContextProvider = <TData extends GridBaseRow>(props: PropsWithC
539
550
  }
540
551
  }, [gridApi]);
541
552
 
542
- // waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
543
- const externallySelectedItemsAreInSyncRef = useRef(false);
544
- useEffect(() => {
545
- externallySelectedItemsAreInSyncRef.current = externallySelectedItemsAreInSync;
546
- }, [externallySelectedItemsAreInSync]);
547
-
548
553
  const waitForExternallySelectedItemsToBeInSync = useCallback(async () => {
549
554
  if (!hasExternallySelectedItemsRef.current) {
550
555
  externallySelectedItemsAreInSyncRef.current = true;
@@ -613,7 +618,7 @@ export const GridContextProvider = <TData extends GridBaseRow>(props: PropsWithC
613
618
  startCellEditingInProgressRef.current = false;
614
619
  }
615
620
  },
616
- [anyUpdating, gridApi, prePopupOps, waitForExternallySelectedItemsToBeInSync],
621
+ [anyUpdating, gridApi, prePopupOps, setExternallySelectedItemsAreInSync, waitForExternallySelectedItemsToBeInSync],
617
622
  );
618
623
 
619
624
  const bulkEditingCompleteCallbackRef = useRef<() => Promise<void> | void>();
@@ -190,6 +190,18 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
190
190
  align-items: center;
191
191
  }
192
192
 
193
+ .ag-cell span.GridCell-dropDownIcon {
194
+ fill: lui.$charcoal;
195
+ max-width: 26px;
196
+ width: 26px;
197
+ visibility: hidden;
198
+ }
199
+
200
+ .ag-cell.ag-cell-inline-editing span.GridCell-dropDownIcon {
201
+ max-width: 24px;
202
+ width: 24px;
203
+ }
204
+
193
205
  .ag-cell .GridCell-editableIcon {
194
206
  fill: lui.$silver;
195
207
  visibility: hidden;