@linzjs/step-ag-grid 29.1.0 → 29.1.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.
@@ -3936,8 +3936,8 @@ const textMatch = (text, filter) => {
3936
3936
  negativeFilters.every((superFilter) => values.every((value) => isMatch(value, superFilter)))));
3937
3937
  };
3938
3938
 
3939
- const useGridPopoverHook = (props) => {
3940
- const { onBulkEditingComplete } = useGridContext();
3939
+ const useGridPopoverHook = ({ className, save, invalid, dontSaveOnExternalClick, }) => {
3940
+ const { onBulkEditingComplete, redrawRows } = useGridContext();
3941
3941
  const { anchorRef, saving, updateValue, stopEditing } = useGridPopoverContext();
3942
3942
  const saveButtonRef = useRef(null);
3943
3943
  const [isOpen, setOpen] = useState(false);
@@ -3948,22 +3948,25 @@ const useGridPopoverHook = (props) => {
3948
3948
  if (reason == CloseReason.CANCEL) {
3949
3949
  stopEditing();
3950
3950
  onBulkEditingComplete();
3951
+ redrawRows();
3951
3952
  return;
3952
3953
  }
3953
- if (props?.invalid?.()) {
3954
+ if (invalid?.()) {
3954
3955
  // Don't close, don't do anything it's invalid
3955
3956
  return;
3956
3957
  }
3957
- if (!props.save) {
3958
+ if (!save) {
3958
3959
  // No save method so just close
3959
3960
  stopEditing();
3960
3961
  onBulkEditingComplete();
3962
+ redrawRows();
3961
3963
  return;
3962
3964
  }
3963
- if (await updateValue(props.save, reason === CloseReason.TAB_FORWARD ? 1 : reason === CloseReason.TAB_BACKWARD ? -1 : 0)) {
3965
+ if (await updateValue(save, reason === CloseReason.TAB_FORWARD ? 1 : reason === CloseReason.TAB_BACKWARD ? -1 : 0)) {
3964
3966
  stopEditing();
3967
+ redrawRows();
3965
3968
  }
3966
- }, [onBulkEditingComplete, props, stopEditing, updateValue]);
3969
+ }, [invalid, onBulkEditingComplete, redrawRows, save, stopEditing, updateValue]);
3967
3970
  const popoverWrapper = useCallback((children) => {
3968
3971
  return (jsx(Fragment, { children: anchorRef.current && (jsxs(ControlledMenu, { state: isOpen ? 'open' : 'closed', portal: true, unmountOnClose: true, anchorRef: anchorRef, saveButtonRef: saveButtonRef, menuClassName: 'step-ag-grid-react-menu', onClose: (event) => {
3969
3972
  // Prevent menu from closing when modals are invoked
@@ -3971,15 +3974,15 @@ const useGridPopoverHook = (props) => {
3971
3974
  return;
3972
3975
  }
3973
3976
  void triggerSave(event.reason);
3974
- }, viewScroll: 'auto', dontShrinkIfDirectionIsTop: true, className: props.className, children: [saving && ( // This is the overlay that prevents editing when the editor is saving
3977
+ }, viewScroll: 'auto', dontShrinkIfDirectionIsTop: true, className: className, children: [saving && ( // This is the overlay that prevents editing when the editor is saving
3975
3978
  jsx("div", { className: 'ComponentLoadingWrapper-saveOverlay' })), children, jsx("button", { ref: saveButtonRef, "data-reason": '', onClick: (e) => {
3976
3979
  let reason = e.currentTarget.getAttribute('data-reason') ?? undefined;
3977
- if (props.dontSaveOnExternalClick && reason === CloseReason.BLUR) {
3980
+ if (dontSaveOnExternalClick && reason === CloseReason.BLUR) {
3978
3981
  reason = CloseReason.CANCEL;
3979
3982
  }
3980
3983
  void triggerSave(reason);
3981
3984
  }, style: { display: 'none' } })] })) }));
3982
- }, [anchorRef, isOpen, props.className, props.dontSaveOnExternalClick, saving, triggerSave]);
3985
+ }, [anchorRef, isOpen, className, dontSaveOnExternalClick, saving, triggerSave]);
3983
3986
  return {
3984
3987
  popoverWrapper,
3985
3988
  triggerSave,
@@ -5059,6 +5062,18 @@ const GridWrapper = ({ children, maxHeight }) => (jsx("div", { className: 'Grid-
5059
5062
  const getColId = (colDef) => colDef.colId ?? '';
5060
5063
  const isFlexColumn = (colDef) => !!colDef.flex && !isGridCellFiller(colDef);
5061
5064
 
5065
+ const waitForCondition = async (condition, timeoutMs) => {
5066
+ const endTime = Date.now() + timeoutMs;
5067
+ while (Date.now() < endTime) {
5068
+ if (condition()) {
5069
+ return true;
5070
+ }
5071
+ await wait(100);
5072
+ }
5073
+ console.warn('waitForCondition failed');
5074
+ return false;
5075
+ };
5076
+
5062
5077
  /**
5063
5078
  * Context for AgGrid operations.
5064
5079
  * Make sure you wrap AgGrid in this.
@@ -5731,17 +5746,6 @@ const downloadCsvUseValueFormattersProcessCellCallback = (params) => {
5731
5746
  // We add an extra encodeToString here just in case valueFormatter is returning non string values
5732
5747
  return encodeToString(result);
5733
5748
  };
5734
- const waitForCondition = async (condition, timeoutMs) => {
5735
- const endTime = Date.now() + timeoutMs;
5736
- while (Date.now() < endTime) {
5737
- if (condition()) {
5738
- return true;
5739
- }
5740
- await wait(100);
5741
- }
5742
- console.warn('waitForCondition failed');
5743
- return false;
5744
- };
5745
5749
 
5746
5750
  const GridUpdatingContextProvider = (props) => {
5747
5751
  const updatingBlocks = useRef({});
@@ -5869,5 +5873,5 @@ const useDeferredPromise = () => {
5869
5873
  };
5870
5874
  };
5871
5875
 
5872
- export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridButton, GridCell, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridIcon, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, TextInputValidator, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, convertDDToDMS, defaultValueFormatter, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, primitiveToSelectOption, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait };
5876
+ export { ActionButton, ComponentLoadingWrapper, ControlledMenu, Editor, FocusableItem, FormError, GenericCellEditorComponentWrapper, Grid, GridButton, GridCell, GridCellFiller, GridCellFillerColId, GridCellMultiEditor, GridCellMultiSelectClassRules, GridCellRenderer, GridContext, GridContextProvider, GridEditBoolean, GridFilterButtons, GridFilterColumnsToggle, GridFilterDownloadCsvButton, GridFilterHeaderIconButton, GridFilterQuick, GridFilters, GridFormDropDown, GridFormEditBearing, GridFormMessage, GridFormMultiSelect, GridFormMultiSelectGrid, GridFormPopoverMenu, GridFormSubComponentTextArea, GridFormSubComponentTextInput, GridFormTextArea, GridFormTextInput, GridIcon, GridLoadableCell, GridNoRowsOverlay, GridNoRowsOverlayFr, GridPopoutEditMultiSelect, GridPopoutEditMultiSelectGrid, GridPopoverContext, GridPopoverContextProvider, GridPopoverEditBearing, GridPopoverEditBearingCorrection, GridPopoverEditBearingCorrectionEditorParams, GridPopoverEditBearingEditorParams, GridPopoverEditDropDown, GridPopoverMenu, GridPopoverMessage, GridPopoverTextArea, GridPopoverTextInput, GridRenderPopoutMenuCell, GridSubComponentContext, GridUpdatingContext, GridUpdatingContextProvider, GridWrapper, Menu, MenuButton, MenuDivider, MenuGroup, MenuHeader, MenuHeaderItem, MenuHeaderString, MenuItem, MenuRadioGroup, MenuSeparator, MenuSeparatorString, PopoutMenuSeparator, SubMenu, TextAreaInput, TextInputFormatted, TextInputValidator, bearingCorrectionRangeValidator, bearingCorrectionValueFormatter, bearingNumberParser, bearingRangeValidator, bearingStringValidator, bearingValueFormatter, convertDDToDMS, defaultValueFormatter, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, primitiveToSelectOption, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait, waitForCondition };
5873
5877
  //# sourceMappingURL=step-ag-grid.esm.js.map