@linzjs/step-ag-grid 30.1.0 → 30.3.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.
@@ -62066,6 +62066,8 @@ styleInject(css_248z$3);
62066
62066
 
62067
62067
  const EMPTY_KEY = '__EMPTY__';
62068
62068
  const DEFAULT_EMPTY_LABEL = '-';
62069
+ const filterStateMap = new Map();
62070
+ const filterClickCountMap = new Map();
62069
62071
  const FilterUI = ({ allValues, selected, labels, labelFormatter, onToggleAll, onToggleOne, }) => {
62070
62072
  const allChecked = allValues.length > 0 && selected.size === allValues.length;
62071
62073
  const getDisplayLabel = (raw) => {
@@ -62084,7 +62086,6 @@ class GridFilterColumnsMultiSelect {
62084
62086
  reactRoot = null;
62085
62087
  filterButtonClickListener = null;
62086
62088
  filterButton = null;
62087
- hasOpened = false;
62088
62089
  normalizeCellValue(value) {
62089
62090
  if (typeof value === 'string')
62090
62091
  return value.trim() === '' ? EMPTY_KEY : value;
@@ -62134,14 +62135,24 @@ class GridFilterColumnsMultiSelect {
62134
62135
  this.filterButton = document.querySelector(`[col-id="${columnId}"] .ag-header-cell-filter-button`);
62135
62136
  if (this.filterButton) {
62136
62137
  this.filterButtonClickListener = (e) => {
62137
- if (this.hasOpened) {
62138
- e.stopPropagation();
62138
+ const clickCount = filterClickCountMap.get(columnId) || 0;
62139
+ filterClickCountMap.set(columnId, clickCount + 1);
62140
+ if (clickCount === 0) {
62141
+ e.stopImmediatePropagation();
62142
+ e.preventDefault();
62143
+ this.params.api.hidePopupMenu();
62144
+ filterStateMap.set(columnId, false);
62145
+ return;
62146
+ }
62147
+ const isOpen = filterStateMap.get(columnId) || false;
62148
+ if (isOpen) {
62149
+ e.stopImmediatePropagation();
62139
62150
  e.preventDefault();
62140
62151
  this.params.api.hidePopupMenu();
62141
- this.hasOpened = false;
62152
+ filterStateMap.set(columnId, false);
62142
62153
  }
62143
62154
  else {
62144
- this.hasOpened = true;
62155
+ filterStateMap.set(columnId, true);
62145
62156
  }
62146
62157
  };
62147
62158
  this.filterButton.addEventListener('click', this.filterButtonClickListener, true);
@@ -63820,16 +63831,22 @@ const GridPopoverEditBearingCorrection = (colDef, props) => GridPopoverEditBeari
63820
63831
  },
63821
63832
  });
63822
63833
 
63823
- const GridPopoverEditDropDown = (colDef, props) => GridCell(colDef, {
63824
- editor: GridFormDropDown,
63825
- ...props,
63826
- editorParams: {
63827
- ...props.editorParams,
63828
- className: clsx({
63829
- 'GridPopoverEditDropDown-containerLarge': !props.editorParams?.className?.includes('GridPopoverEditDropDown-container'),
63830
- }, props.editorParams?.className),
63831
- },
63832
- });
63834
+ const GridPopoverEditDropDown = (colDef, props) => {
63835
+ colDef.cellRendererParams = {
63836
+ rightHoverElement: (jsx(GridIcon, { icon: 'ic_arrow_drop_down', title: '', className: 'GridCell-editableIcon GridCell-dropDownIcon' })),
63837
+ ...colDef.cellRendererParams,
63838
+ };
63839
+ return GridCell(colDef, {
63840
+ editor: GridFormDropDown,
63841
+ ...props,
63842
+ editorParams: {
63843
+ ...props.editorParams,
63844
+ className: clsx({
63845
+ 'GridPopoverEditDropDown-containerLarge': !props.editorParams?.className?.includes('GridPopoverEditDropDown-container'),
63846
+ }, props.editorParams?.className),
63847
+ },
63848
+ });
63849
+ };
63833
63850
 
63834
63851
  const GridRenderPopoutMenuCell = (props) => {
63835
63852
  const disabled = !fnOrVar(props.colDef?.editable, props);
@@ -63912,8 +63929,14 @@ const GridContextProvider = (props) => {
63912
63929
  const enableMultilineBulkEditRef = useRef(false);
63913
63930
  const idsBeforeUpdate = useRef([]);
63914
63931
  const prePopupFocusedCell = useRef();
63915
- const [externallySelectedItemsAreInSync, setExternallySelectedItemsAreInSync] = useState(false);
63932
+ const [externallySelectedItemsAreInSync, _setExternallySelectedItemsAreInSync] = useState(false);
63916
63933
  const externalFilters = useRef([]);
63934
+ // waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
63935
+ const externallySelectedItemsAreInSyncRef = useRef(false);
63936
+ const setExternallySelectedItemsAreInSync = useCallback((cond) => {
63937
+ _setExternallySelectedItemsAreInSync(cond);
63938
+ externallySelectedItemsAreInSyncRef.current = cond;
63939
+ }, [_setExternallySelectedItemsAreInSync]);
63917
63940
  const setQuickFilter = useCallback((filter) => {
63918
63941
  // If we don't clear the focused cell focus switches back to grid when typing in the quick filter input
63919
63942
  gridApi?.clearFocusedCell();
@@ -64260,11 +64283,6 @@ const GridContextProvider = (props) => {
64260
64283
  });
64261
64284
  }
64262
64285
  }, [gridApi]);
64263
- // waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
64264
- const externallySelectedItemsAreInSyncRef = useRef(false);
64265
- useEffect(() => {
64266
- externallySelectedItemsAreInSyncRef.current = externallySelectedItemsAreInSync;
64267
- }, [externallySelectedItemsAreInSync]);
64268
64286
  const waitForExternallySelectedItemsToBeInSync = useCallback(async () => {
64269
64287
  if (!hasExternallySelectedItemsRef.current) {
64270
64288
  externallySelectedItemsAreInSyncRef.current = true;
@@ -64320,7 +64338,7 @@ const GridContextProvider = (props) => {
64320
64338
  finally {
64321
64339
  startCellEditingInProgressRef.current = false;
64322
64340
  }
64323
- }, [anyUpdating, gridApi, prePopupOps, waitForExternallySelectedItemsToBeInSync]);
64341
+ }, [anyUpdating, gridApi, prePopupOps, setExternallySelectedItemsAreInSync, waitForExternallySelectedItemsToBeInSync]);
64324
64342
  const bulkEditingCompleteCallbackRef = useRef();
64325
64343
  const onBulkEditingComplete = useCallback(async () => {
64326
64344
  await bulkEditingCompleteCallbackRef.current?.();