@linzjs/step-ag-grid 30.2.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);