@linzjs/step-ag-grid 30.3.0 → 30.4.1
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/src/components/gridForm/GridFormInlineTextInput.d.ts +5 -0
- package/dist/src/contexts/GridPopoverContext.d.ts +1 -1
- package/dist/src/react-menu3/positionUtils/placeArrowHorizontal.d.ts +2 -2
- package/dist/src/react-menu3/positionUtils/placeArrowVertical.d.ts +2 -2
- package/dist/src/react-menu3/positionUtils/placeLeftorRight.d.ts +2 -2
- package/dist/src/react-menu3/positionUtils/placeToporBottom.d.ts +2 -2
- package/dist/src/react-menu3/positionUtils/positionMenu.d.ts +3 -3
- package/dist/src/react-menu3/types.d.ts +1 -1
- package/dist/step-ag-grid.cjs +35 -24
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +35 -24
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/Grid.tsx +3 -3
- package/src/components/gridForm/GridFormInlineTextInput.tsx +9 -1
- package/src/contexts/GridContextProvider.tsx +3 -3
- package/src/contexts/GridPopoverContext.tsx +2 -2
- package/src/contexts/GridUpdatingContextProvider.tsx +10 -7
- package/src/lui/reactUtils.tsx +1 -1
- package/src/lui/timeoutHook.tsx +1 -1
- package/src/react-menu3/components/ControlledMenu.tsx +3 -3
- package/src/react-menu3/components/SubMenu.tsx +1 -1
- package/src/react-menu3/hooks/useItemState.ts +1 -1
- package/src/react-menu3/positionUtils/placeArrowHorizontal.ts +2 -2
- package/src/react-menu3/positionUtils/placeArrowVertical.ts +2 -2
- package/src/react-menu3/positionUtils/placeLeftorRight.ts +2 -2
- package/src/react-menu3/positionUtils/placeToporBottom.ts +2 -2
- package/src/react-menu3/positionUtils/positionMenu.ts +3 -3
- package/src/react-menu3/types.ts +1 -1
- package/src/stories/grid/GridInlineText.stories.tsx +99 -18
- package/src/stories/grid/interactions/GridKeyboardInteractions.stories.tsx +12 -3
- package/src/utils/deferredPromise.ts +2 -2
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -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:
|
|
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]);
|
|
@@ -63177,7 +63177,14 @@ const GridFormInlineTextInput = (props) => {
|
|
|
63177
63177
|
input?.removeEventListener('keydown', tabRecorder, { capture: true });
|
|
63178
63178
|
};
|
|
63179
63179
|
}, [tabRecorder]);
|
|
63180
|
-
return (jsx("div", { className: clsx('GridFormInlineTextInput', invalid() && 'GridFormInlineTextInput-error'), title: String(invalid() ?? ''), children: jsx("input", { ref: inputRef, type: 'text', value: value, onChange: (e) =>
|
|
63180
|
+
return (jsx("div", { className: clsx('GridFormInlineTextInput', invalid() && 'GridFormInlineTextInput-error'), title: String(invalid() ?? ''), children: jsx("input", { ref: inputRef, type: 'text', value: value, onChange: (e) => {
|
|
63181
|
+
setValue(e.target.value);
|
|
63182
|
+
if (props.onChange) {
|
|
63183
|
+
const selectedRows = getSelectedRows();
|
|
63184
|
+
const selectedRowIds = selectedRows.map((data) => data.id);
|
|
63185
|
+
props.onChange({ selectedRows, selectedRowIds, value: e.target.value });
|
|
63186
|
+
}
|
|
63187
|
+
}, placeholder: props.placeholder ?? 'Type here', onBlur: () => {
|
|
63181
63188
|
void triggerSave(CloseReason.BLUR);
|
|
63182
63189
|
}, onKeyUp: (e) => {
|
|
63183
63190
|
if (e.key === 'Enter') {
|
|
@@ -63924,11 +63931,11 @@ const GridContextProvider = (props) => {
|
|
|
63924
63931
|
const [gridReady, setGridReady] = useState(false);
|
|
63925
63932
|
const [quickFilter, _setQuickFilter] = useState('');
|
|
63926
63933
|
const [invisibleColumnIds, _setInvisibleColumnIds] = useState();
|
|
63927
|
-
const testId = useRef();
|
|
63934
|
+
const testId = useRef(undefined);
|
|
63928
63935
|
const hasExternallySelectedItemsRef = useRef(false);
|
|
63929
63936
|
const enableMultilineBulkEditRef = useRef(false);
|
|
63930
63937
|
const idsBeforeUpdate = useRef([]);
|
|
63931
|
-
const prePopupFocusedCell = useRef();
|
|
63938
|
+
const prePopupFocusedCell = useRef(undefined);
|
|
63932
63939
|
const [externallySelectedItemsAreInSync, _setExternallySelectedItemsAreInSync] = useState(false);
|
|
63933
63940
|
const externalFilters = useRef([]);
|
|
63934
63941
|
// waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
|
|
@@ -64339,7 +64346,7 @@ const GridContextProvider = (props) => {
|
|
|
64339
64346
|
startCellEditingInProgressRef.current = false;
|
|
64340
64347
|
}
|
|
64341
64348
|
}, [anyUpdating, gridApi, prePopupOps, setExternallySelectedItemsAreInSync, waitForExternallySelectedItemsToBeInSync]);
|
|
64342
|
-
const bulkEditingCompleteCallbackRef = useRef();
|
|
64349
|
+
const bulkEditingCompleteCallbackRef = useRef(undefined);
|
|
64343
64350
|
const onBulkEditingComplete = useCallback(async () => {
|
|
64344
64351
|
await bulkEditingCompleteCallbackRef.current?.();
|
|
64345
64352
|
}, []);
|
|
@@ -64657,13 +64664,17 @@ const GridUpdatingContextProvider = (props) => {
|
|
|
64657
64664
|
const fieldUpdatingIds = updatingBlocks.current[field] ?? (updatingBlocks.current[field] = []);
|
|
64658
64665
|
fieldUpdatingIds.push(idRef);
|
|
64659
64666
|
});
|
|
64660
|
-
|
|
64661
|
-
|
|
64662
|
-
|
|
64663
|
-
|
|
64664
|
-
|
|
64665
|
-
|
|
64666
|
-
|
|
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
|
+
}
|
|
64667
64678
|
}, [resetUpdating]);
|
|
64668
64679
|
const anyUpdating = useCallback(() => {
|
|
64669
64680
|
return !isEmpty(updating.current);
|
|
@@ -64711,8 +64722,8 @@ const ActionButton = ({ icon, name, inProgressName, disabled, dataTestId, style,
|
|
|
64711
64722
|
};
|
|
64712
64723
|
|
|
64713
64724
|
const useDeferredPromise = () => {
|
|
64714
|
-
const promiseResolve = useRef();
|
|
64715
|
-
const promiseReject = useRef();
|
|
64725
|
+
const promiseResolve = useRef(undefined);
|
|
64726
|
+
const promiseReject = useRef(undefined);
|
|
64716
64727
|
// End promise on unload
|
|
64717
64728
|
useEffect(() => {
|
|
64718
64729
|
return () => {
|