@linzjs/step-ag-grid 27.1.0 → 27.2.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.
@@ -2159,7 +2159,7 @@ const ControlledMenuFr = ({ 'aria-label': ariaLabel, className, containerProps,
2159
2159
  block: menuContainerClass,
2160
2160
  modifiers,
2161
2161
  className,
2162
- }), style: { ...containerProps?.style, position: 'relative' }, ref: containerRef, children: state && (jsx(SettingsContext.Provider, { value: settings, children: jsx(ItemSettingsContext.Provider, { value: itemSettings, children: jsx(EventHandlersContext.Provider, { value: eventHandlers, children: jsx(MenuList, { ...restProps, ariaLabel: ariaLabel || 'Menu', externalRef: externalRef, containerRef: containerRef, onClose: onClose, onBlur: () => console.log('blur') }) }) }) })) }));
2162
+ }), style: { ...containerProps?.style, position: 'relative' }, ref: containerRef, children: state && (jsx(SettingsContext.Provider, { value: settings, children: jsx(ItemSettingsContext.Provider, { value: itemSettings, children: jsx(EventHandlersContext.Provider, { value: eventHandlers, children: jsx(MenuList, { ...restProps, ariaLabel: ariaLabel || 'Menu', externalRef: externalRef, containerRef: containerRef, onClose: onClose }) }) }) })) }));
2163
2163
  if (portal === true && anchorRef?.current != null) {
2164
2164
  if (hasParentClass('react-menu-inline-test', anchorRef.current)) {
2165
2165
  portal = false;
@@ -3945,6 +3945,12 @@ const useGridPopoverHook = (props) => {
3945
3945
  };
3946
3946
  };
3947
3947
 
3948
+ const primitiveToSelectOption = (value) => {
3949
+ return {
3950
+ value: value,
3951
+ label: value ? String(value) : '',
3952
+ };
3953
+ };
3948
3954
  const MenuSeparatorString = '_____MENU_SEPARATOR_____';
3949
3955
  const MenuSeparator = Object.freeze({ value: MenuSeparatorString });
3950
3956
  const MenuHeaderString = '_____MENU_HEADER_____';
@@ -3993,14 +3999,7 @@ const GridFormDropDown = (props) => {
3993
3999
  optionsConf = await optionsConf(selectedRows, filter);
3994
4000
  }
3995
4001
  if (optionsConf !== undefined) {
3996
- const optionsList = optionsConf?.map((item) => item == null || typeof item === 'string'
3997
- ? {
3998
- value: item,
3999
- label: item,
4000
- disabled: false,
4001
- }
4002
- : item);
4003
- setOptions(optionsList);
4002
+ setOptions(optionsConf);
4004
4003
  }
4005
4004
  })();
4006
4005
  }, [filter, options, props, selectedRows]);
@@ -4097,7 +4096,7 @@ const GridFormDropDown = (props) => {
4097
4096
  }
4098
4097
  }, onClick: (e) => {
4099
4098
  e.keepOpen = !!item.subComponent;
4100
- }, children: [item.label ?? (item.value == null ? `<${item.value}>` : `${item.value}`), item.subComponent ? '...' : ''] }, `${fieldToString(field)}-${index}`), item.subComponent && selectedItem === item && (jsx(FocusableItem, { className: 'LuiDeprecatedForms', children: () => (jsx(GridSubComponentContext.Provider, { value: {
4099
+ }, children: [item.label ?? (item.value == null ? `<${String(item.value)}>` : `${String(item.value)}`), item.subComponent ? '...' : ''] }, `${fieldToString(field)}-${index}`), item.subComponent && selectedItem === item && (jsx(FocusableItem, { className: 'LuiDeprecatedForms', children: () => (jsx(GridSubComponentContext.Provider, { value: {
4101
4100
  context: { options },
4102
4101
  data,
4103
4102
  value: subSelectedValue,
@@ -5059,7 +5058,7 @@ const GridContextProvider = (props) => {
5059
5058
  if (!noApiFn) {
5060
5059
  noApiFn = (() => { });
5061
5060
  }
5062
- return gridApi ? hasApiFn(gridApi) : noApiFn();
5061
+ return gridApi && !gridApi.isDestroyed() ? hasApiFn(gridApi) : noApiFn();
5063
5062
  }, [gridApi]);
5064
5063
  /**
5065
5064
  * Scroll row into view by Id.
@@ -5224,9 +5223,9 @@ const GridContextProvider = (props) => {
5224
5223
  // as they will start to edit the cell before this stuff has a chance to run
5225
5224
  colId &&
5226
5225
  delay(() => {
5227
- if (isEmpty(gridApi.getEditingCells()) &&
5228
- (!ifNoCellFocused || gridApi.getFocusedCell() == null) &&
5229
- !gridApi.isDestroyed()) {
5226
+ if (!gridApi.isDestroyed() &&
5227
+ isEmpty(gridApi.getEditingCells()) &&
5228
+ (!ifNoCellFocused || gridApi.getFocusedCell() == null)) {
5230
5229
  gridApi.setFocusedCell(rowIndex, colId);
5231
5230
  // It may be that the first cell is the selection cell, this doesn't exist as a colDef
5232
5231
  // so instead, I just try and select it. If it doesn't exist selection will stay on the
@@ -5331,7 +5330,9 @@ const GridContextProvider = (props) => {
5331
5330
  * Resize columns to fit container
5332
5331
  */
5333
5332
  const sizeColumnsToFit = useCallback(() => {
5334
- gridApi?.sizeColumnsToFit();
5333
+ if (gridApi && !gridApi?.isDestroyed()) {
5334
+ gridApi.sizeColumnsToFit();
5335
+ }
5335
5336
  }, [gridApi]);
5336
5337
  const stopEditing = useCallback(() => {
5337
5338
  if (!gridApi || gridApi.isDestroyed()) {
@@ -5478,6 +5479,9 @@ const GridContextProvider = (props) => {
5478
5479
  // I've left them here just in case they are
5479
5480
  // async processes need to refresh their own rows
5480
5481
  // gridApi.refreshCells({ rowNodes: selectedRows as RowNode[], force: true });
5482
+ if (gridApi.isDestroyed()) {
5483
+ return ok;
5484
+ }
5481
5485
  if (ok) {
5482
5486
  const cell = gridApi.getFocusedCell();
5483
5487
  if (cell && gridApi.getFocusedCell() == null) {
@@ -5799,5 +5803,5 @@ const useDeferredPromise = () => {
5799
5803
  };
5800
5804
  };
5801
5805
 
5802
- 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, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait };
5806
+ 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, downloadCsvUseValueFormattersProcessCellCallback, findParentWithClass, fnOrVar, generateFilterGetter, hasParentClass, isFloat, isGridCellFiller, isNotEmpty, primitiveToSelectOption, sanitiseFileName, stringByteLengthIsInvalid, suppressCellKeyboardEvents, textMatch, useDeferredPromise, useGridContext, useGridContextMenu, useGridFilter, useGridPopoverContext, useGridPopoverHook, useMenuState, usePostSortRowsHook, wait };
5803
5807
  //# sourceMappingURL=step-ag-grid.esm.js.map