@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.
@@ -18,7 +18,6 @@ export declare class GridFilterColumnsMultiSelect implements IFilterComp {
18
18
  private reactRoot;
19
19
  private filterButtonClickListener;
20
20
  private filterButton;
21
- private hasOpened;
22
21
  private normalizeCellValue;
23
22
  private loadFieldValues;
24
23
  init(params: CheckboxMultiFilterParams): void;
@@ -62068,6 +62068,8 @@ styleInject(css_248z$3);
62068
62068
 
62069
62069
  const EMPTY_KEY = '__EMPTY__';
62070
62070
  const DEFAULT_EMPTY_LABEL = '-';
62071
+ const filterStateMap = new Map();
62072
+ const filterClickCountMap = new Map();
62071
62073
  const FilterUI = ({ allValues, selected, labels, labelFormatter, onToggleAll, onToggleOne, }) => {
62072
62074
  const allChecked = allValues.length > 0 && selected.size === allValues.length;
62073
62075
  const getDisplayLabel = (raw) => {
@@ -62086,7 +62088,6 @@ class GridFilterColumnsMultiSelect {
62086
62088
  reactRoot = null;
62087
62089
  filterButtonClickListener = null;
62088
62090
  filterButton = null;
62089
- hasOpened = false;
62090
62091
  normalizeCellValue(value) {
62091
62092
  if (typeof value === 'string')
62092
62093
  return value.trim() === '' ? EMPTY_KEY : value;
@@ -62136,14 +62137,24 @@ class GridFilterColumnsMultiSelect {
62136
62137
  this.filterButton = document.querySelector(`[col-id="${columnId}"] .ag-header-cell-filter-button`);
62137
62138
  if (this.filterButton) {
62138
62139
  this.filterButtonClickListener = (e) => {
62139
- if (this.hasOpened) {
62140
- e.stopPropagation();
62140
+ const clickCount = filterClickCountMap.get(columnId) || 0;
62141
+ filterClickCountMap.set(columnId, clickCount + 1);
62142
+ if (clickCount === 0) {
62143
+ e.stopImmediatePropagation();
62144
+ e.preventDefault();
62145
+ this.params.api.hidePopupMenu();
62146
+ filterStateMap.set(columnId, false);
62147
+ return;
62148
+ }
62149
+ const isOpen = filterStateMap.get(columnId) || false;
62150
+ if (isOpen) {
62151
+ e.stopImmediatePropagation();
62141
62152
  e.preventDefault();
62142
62153
  this.params.api.hidePopupMenu();
62143
- this.hasOpened = false;
62154
+ filterStateMap.set(columnId, false);
62144
62155
  }
62145
62156
  else {
62146
- this.hasOpened = true;
62157
+ filterStateMap.set(columnId, true);
62147
62158
  }
62148
62159
  };
62149
62160
  this.filterButton.addEventListener('click', this.filterButtonClickListener, true);