@linzjs/step-ag-grid 30.0.0 → 30.1.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.
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +4 -0
- package/dist/step-ag-grid.cjs +27 -0
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +27 -0
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +30 -2
- package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +5 -1
package/dist/step-ag-grid.esm.js
CHANGED
|
@@ -62082,6 +62082,9 @@ class GridFilterColumnsMultiSelect {
|
|
|
62082
62082
|
gui;
|
|
62083
62083
|
labelFormatter;
|
|
62084
62084
|
reactRoot = null;
|
|
62085
|
+
filterButtonClickListener = null;
|
|
62086
|
+
filterButton = null;
|
|
62087
|
+
hasOpened = false;
|
|
62085
62088
|
normalizeCellValue(value) {
|
|
62086
62089
|
if (typeof value === 'string')
|
|
62087
62090
|
return value.trim() === '' ? EMPTY_KEY : value;
|
|
@@ -62124,6 +62127,25 @@ class GridFilterColumnsMultiSelect {
|
|
|
62124
62127
|
this.gui = document.createElement('div');
|
|
62125
62128
|
this.reactRoot = createRoot(this.gui);
|
|
62126
62129
|
this.render();
|
|
62130
|
+
this.setupFilterButtonListener();
|
|
62131
|
+
}
|
|
62132
|
+
setupFilterButtonListener() {
|
|
62133
|
+
const columnId = this.params.column.getColId();
|
|
62134
|
+
this.filterButton = document.querySelector(`[col-id="${columnId}"] .ag-header-cell-filter-button`);
|
|
62135
|
+
if (this.filterButton) {
|
|
62136
|
+
this.filterButtonClickListener = (e) => {
|
|
62137
|
+
if (this.hasOpened) {
|
|
62138
|
+
e.stopPropagation();
|
|
62139
|
+
e.preventDefault();
|
|
62140
|
+
this.params.api.hidePopupMenu();
|
|
62141
|
+
this.hasOpened = false;
|
|
62142
|
+
}
|
|
62143
|
+
else {
|
|
62144
|
+
this.hasOpened = true;
|
|
62145
|
+
}
|
|
62146
|
+
};
|
|
62147
|
+
this.filterButton.addEventListener('click', this.filterButtonClickListener, true);
|
|
62148
|
+
}
|
|
62127
62149
|
}
|
|
62128
62150
|
render() {
|
|
62129
62151
|
if (!this.reactRoot)
|
|
@@ -62179,6 +62201,11 @@ class GridFilterColumnsMultiSelect {
|
|
|
62179
62201
|
this.render();
|
|
62180
62202
|
}
|
|
62181
62203
|
destroy() {
|
|
62204
|
+
if (this.filterButtonClickListener && this.filterButton) {
|
|
62205
|
+
this.filterButton.removeEventListener('click', this.filterButtonClickListener, true);
|
|
62206
|
+
this.filterButtonClickListener = null;
|
|
62207
|
+
this.filterButton = null;
|
|
62208
|
+
}
|
|
62182
62209
|
if (this.reactRoot) {
|
|
62183
62210
|
this.reactRoot.unmount();
|
|
62184
62211
|
this.reactRoot = null;
|