@linzjs/step-ag-grid 30.4.0 → 30.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.
Files changed (31) hide show
  1. package/dist/index.css +1 -1
  2. package/dist/src/contexts/GridPopoverContext.d.ts +1 -1
  3. package/dist/src/react-menu3/positionUtils/placeArrowHorizontal.d.ts +2 -2
  4. package/dist/src/react-menu3/positionUtils/placeArrowVertical.d.ts +2 -2
  5. package/dist/src/react-menu3/positionUtils/placeLeftorRight.d.ts +2 -2
  6. package/dist/src/react-menu3/positionUtils/placeToporBottom.d.ts +2 -2
  7. package/dist/src/react-menu3/positionUtils/positionMenu.d.ts +3 -3
  8. package/dist/src/react-menu3/types.d.ts +1 -1
  9. package/dist/step-ag-grid.cjs +27 -23
  10. package/dist/step-ag-grid.cjs.map +1 -1
  11. package/dist/step-ag-grid.esm.js +27 -23
  12. package/dist/step-ag-grid.esm.js.map +1 -1
  13. package/package.json +2 -2
  14. package/src/components/Grid.tsx +3 -3
  15. package/src/contexts/GridContextProvider.tsx +3 -3
  16. package/src/contexts/GridPopoverContext.tsx +2 -2
  17. package/src/contexts/GridUpdatingContextProvider.tsx +10 -7
  18. package/src/lui/reactUtils.tsx +1 -1
  19. package/src/lui/timeoutHook.tsx +1 -1
  20. package/src/react-menu3/components/ControlledMenu.tsx +3 -3
  21. package/src/react-menu3/components/SubMenu.tsx +1 -1
  22. package/src/react-menu3/hooks/useItemState.ts +1 -1
  23. package/src/react-menu3/positionUtils/placeArrowHorizontal.ts +2 -2
  24. package/src/react-menu3/positionUtils/placeArrowVertical.ts +2 -2
  25. package/src/react-menu3/positionUtils/placeLeftorRight.ts +2 -2
  26. package/src/react-menu3/positionUtils/placeToporBottom.ts +2 -2
  27. package/src/react-menu3/positionUtils/positionMenu.ts +3 -3
  28. package/src/react-menu3/types.ts +1 -1
  29. package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +12 -3
  30. package/src/styles/react-menu-customisations.scss +1 -1
  31. package/src/utils/deferredPromise.ts +2 -2
@@ -58929,7 +58929,7 @@ const MenuListItemContext = createContext({
58929
58929
  const useItemState = (menuItemRef, focusRef, isHovering, isDisabled) => {
58930
58930
  const { submenuCloseDelay } = useContext(ItemSettingsContext);
58931
58931
  const { isParentOpen, isSubmenuOpen, dispatch, updateItems } = useContext(MenuListItemContext);
58932
- const timeoutId = useRef();
58932
+ const timeoutId = useRef(undefined);
58933
58933
  const setHover = () => {
58934
58934
  !isHovering && !isDisabled && dispatch(HoverActionTypes.SET, menuItemRef?.current, 0);
58935
58935
  };
@@ -59822,7 +59822,7 @@ const MenuList = ({ ariaLabel, menuClassName, menuStyle, arrowClassName, arrowSt
59822
59822
  };
59823
59823
 
59824
59824
  const ControlledMenuFr = ({ 'aria-label': ariaLabel, className, containerProps, initialMounted, unmountOnClose, transition, transitionTimeout, boundingBoxRef, boundingBoxPadding, reposition = 'auto', submenuOpenDelay = 300, submenuCloseDelay = 150, skipOpen, viewScroll = 'initial', portal, theming, onItemClick, onClose, saveButtonRef, ...restProps }, externalRef) => {
59825
- const containerRef = useRef();
59825
+ const containerRef = useRef(undefined);
59826
59826
  const scrollNodesRef = useRef({});
59827
59827
  const { anchorRef, state } = restProps;
59828
59828
  const settings = useMemo(() => ({
@@ -59884,8 +59884,8 @@ const ControlledMenuFr = ({ 'aria-label': ariaLabel, className, containerProps,
59884
59884
  ev.stopPropagation();
59885
59885
  }
59886
59886
  }, [isWithinMenu]);
59887
- const lastTabDownEl = useRef();
59888
- const lastEnterDownEl = useRef();
59887
+ const lastTabDownEl = useRef(undefined);
59888
+ const lastEnterDownEl = useRef(undefined);
59889
59889
  const handleKeyboardTabAndEnter = useCallback((isDown) => (ev) => {
59890
59890
  const thisDocument = anchorRef?.current ? anchorRef?.current.ownerDocument : document;
59891
59891
  const activeElement = thisDocument.activeElement;
@@ -60310,7 +60310,7 @@ const SubMenuFr = ({ 'aria-label': ariaLabel, className, disabled, direction, la
60310
60310
  const isDisabled = !!disabled;
60311
60311
  const isOpen = isMenuOpen(state);
60312
60312
  const containerRef = useRef(null);
60313
- const timeoutId = useRef();
60313
+ const timeoutId = useRef(undefined);
60314
60314
  const stopTimer = () => {
60315
60315
  if (timeoutId.current) {
60316
60316
  clearTimeout(timeoutId.current);
@@ -61108,7 +61108,7 @@ maxInitialWidth,
61108
61108
  }, [propStartCellEditing]);
61109
61109
  const { updatedDep, anyUpdating, updatingCols } = useContext(GridUpdatingContext);
61110
61110
  const gridDivRef = useRef(null);
61111
- const lastSelectedIds = useRef();
61111
+ const lastSelectedIds = useRef(undefined);
61112
61112
  const [staleGrid, setStaleGrid] = useState(false);
61113
61113
  const [autoSized, setAutoSized] = useState(false);
61114
61114
  const postSortRows = usePostSortRowsHook({ setStaleGrid });
@@ -61194,7 +61194,7 @@ maxInitialWidth,
61194
61194
  initialContentSizeInProgressRef.current = false;
61195
61195
  }
61196
61196
  }, [autoSizeColumns, gridRenderState, maxInitialWidth, params, rowData, sizeColumns, sizeColumnsToFit]);
61197
- const lastOwnerDocumentRef = useRef();
61197
+ const lastOwnerDocumentRef = useRef(undefined);
61198
61198
  const wasVisibleRef = useRef(false);
61199
61199
  /**
61200
61200
  * Auto-size windows that had deferred auto-size
@@ -61675,7 +61675,7 @@ maxInitialWidth,
61675
61675
  el.classList.remove('ag-row-highlight-below');
61676
61676
  });
61677
61677
  }, []);
61678
- const gridElementRef = useRef();
61678
+ const gridElementRef = useRef(undefined);
61679
61679
  const onRowDragMove = useCallback((event) => {
61680
61680
  if (startDragYRef.current === null) {
61681
61681
  startDragYRef.current = event.y;
@@ -61837,7 +61837,7 @@ const NotAGridValueFormatterCall = {
61837
61837
  };
61838
61838
 
61839
61839
  const GridPopoverContext = createContext({
61840
- anchorRef: { current: null },
61840
+ anchorRef: { current: undefined },
61841
61841
  saving: false,
61842
61842
  setSaving: () => { },
61843
61843
  stopEditing: () => { },
@@ -62319,7 +62319,7 @@ const GridFilterColumnsToggle = ({ saveState = true }) => {
62319
62319
  * but there's no way to enforce that, so it would lead to bugs.
62320
62320
  */
62321
62321
  const useTimeoutHook = () => {
62322
- const timeout = useRef();
62322
+ const timeout = useRef(undefined);
62323
62323
  /**
62324
62324
  * Clear any pending timeouts.
62325
62325
  */
@@ -62509,7 +62509,7 @@ const FormError = (props) => {
62509
62509
  * @param value Value to track.
62510
62510
  */
62511
62511
  const usePrevious = (value) => {
62512
- const ref = useRef();
62512
+ const ref = useRef(undefined);
62513
62513
  useEffect(() => {
62514
62514
  ref.current = value;
62515
62515
  }, [value]);
@@ -63931,11 +63931,11 @@ const GridContextProvider = (props) => {
63931
63931
  const [gridReady, setGridReady] = useState(false);
63932
63932
  const [quickFilter, _setQuickFilter] = useState('');
63933
63933
  const [invisibleColumnIds, _setInvisibleColumnIds] = useState();
63934
- const testId = useRef();
63934
+ const testId = useRef(undefined);
63935
63935
  const hasExternallySelectedItemsRef = useRef(false);
63936
63936
  const enableMultilineBulkEditRef = useRef(false);
63937
63937
  const idsBeforeUpdate = useRef([]);
63938
- const prePopupFocusedCell = useRef();
63938
+ const prePopupFocusedCell = useRef(undefined);
63939
63939
  const [externallySelectedItemsAreInSync, _setExternallySelectedItemsAreInSync] = useState(false);
63940
63940
  const externalFilters = useRef([]);
63941
63941
  // waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
@@ -64346,7 +64346,7 @@ const GridContextProvider = (props) => {
64346
64346
  startCellEditingInProgressRef.current = false;
64347
64347
  }
64348
64348
  }, [anyUpdating, gridApi, prePopupOps, setExternallySelectedItemsAreInSync, waitForExternallySelectedItemsToBeInSync]);
64349
- const bulkEditingCompleteCallbackRef = useRef();
64349
+ const bulkEditingCompleteCallbackRef = useRef(undefined);
64350
64350
  const onBulkEditingComplete = useCallback(async () => {
64351
64351
  await bulkEditingCompleteCallbackRef.current?.();
64352
64352
  }, []);
@@ -64664,13 +64664,17 @@ const GridUpdatingContextProvider = (props) => {
64664
64664
  const fieldUpdatingIds = updatingBlocks.current[field] ?? (updatingBlocks.current[field] = []);
64665
64665
  fieldUpdatingIds.push(idRef);
64666
64666
  });
64667
- resetUpdating();
64668
- await fn();
64669
- castArray(fields).forEach((field) => {
64670
- const fieldUpdatingIds = updatingBlocks.current[field];
64671
- remove(fieldUpdatingIds, (idList) => idList === idRef);
64672
- });
64673
- resetUpdating();
64667
+ try {
64668
+ resetUpdating();
64669
+ await fn();
64670
+ }
64671
+ finally {
64672
+ castArray(fields).forEach((field) => {
64673
+ const fieldUpdatingIds = updatingBlocks.current[field];
64674
+ remove(fieldUpdatingIds, (idList) => idList === idRef);
64675
+ });
64676
+ resetUpdating();
64677
+ }
64674
64678
  }, [resetUpdating]);
64675
64679
  const anyUpdating = useCallback(() => {
64676
64680
  return !isEmpty(updating.current);
@@ -64718,8 +64722,8 @@ const ActionButton = ({ icon, name, inProgressName, disabled, dataTestId, style,
64718
64722
  };
64719
64723
 
64720
64724
  const useDeferredPromise = () => {
64721
- const promiseResolve = useRef();
64722
- const promiseReject = useRef();
64725
+ const promiseResolve = useRef(undefined);
64726
+ const promiseReject = useRef(undefined);
64723
64727
  // End promise on unload
64724
64728
  useEffect(() => {
64725
64729
  return () => {