@linzjs/step-ag-grid 30.0.0 → 30.2.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/GridTheme.scss +12 -0
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +4 -0
- package/dist/step-ag-grid.cjs +51 -17
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +51 -17
- 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/components/gridPopoverEdit/{GridPopoverEditDropDown.ts → GridPopoverEditDropDown.tsx} +10 -2
- package/src/contexts/GridContextProvider.tsx +13 -8
- package/src/stories/grid/GridFilterColumnsMultiSelect.stories.tsx +5 -1
- package/src/styles/GridTheme.scss +12 -0
package/dist/GridTheme.scss
CHANGED
|
@@ -190,6 +190,18 @@ $grid-base-font-size: calc(#{lui.$base-font-size} - 1px);
|
|
|
190
190
|
align-items: center;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
+
.ag-cell span.GridCell-dropDownIcon {
|
|
194
|
+
fill: lui.$charcoal;
|
|
195
|
+
max-width: 26px;
|
|
196
|
+
width: 26px;
|
|
197
|
+
visibility: hidden;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.ag-cell.ag-cell-inline-editing span.GridCell-dropDownIcon {
|
|
201
|
+
max-width: 24px;
|
|
202
|
+
width: 24px;
|
|
203
|
+
}
|
|
204
|
+
|
|
193
205
|
.ag-cell .GridCell-editableIcon {
|
|
194
206
|
fill: lui.$silver;
|
|
195
207
|
visibility: hidden;
|
|
@@ -16,9 +16,13 @@ export declare class GridFilterColumnsMultiSelect implements IFilterComp {
|
|
|
16
16
|
private gui;
|
|
17
17
|
private labelFormatter?;
|
|
18
18
|
private reactRoot;
|
|
19
|
+
private filterButtonClickListener;
|
|
20
|
+
private filterButton;
|
|
21
|
+
private hasOpened;
|
|
19
22
|
private normalizeCellValue;
|
|
20
23
|
private loadFieldValues;
|
|
21
24
|
init(params: CheckboxMultiFilterParams): void;
|
|
25
|
+
private setupFilterButtonListener;
|
|
22
26
|
private render;
|
|
23
27
|
private handleToggleAll;
|
|
24
28
|
private handleToggleOne;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -62084,6 +62084,9 @@ class GridFilterColumnsMultiSelect {
|
|
|
62084
62084
|
gui;
|
|
62085
62085
|
labelFormatter;
|
|
62086
62086
|
reactRoot = null;
|
|
62087
|
+
filterButtonClickListener = null;
|
|
62088
|
+
filterButton = null;
|
|
62089
|
+
hasOpened = false;
|
|
62087
62090
|
normalizeCellValue(value) {
|
|
62088
62091
|
if (typeof value === 'string')
|
|
62089
62092
|
return value.trim() === '' ? EMPTY_KEY : value;
|
|
@@ -62126,6 +62129,25 @@ class GridFilterColumnsMultiSelect {
|
|
|
62126
62129
|
this.gui = document.createElement('div');
|
|
62127
62130
|
this.reactRoot = client.createRoot(this.gui);
|
|
62128
62131
|
this.render();
|
|
62132
|
+
this.setupFilterButtonListener();
|
|
62133
|
+
}
|
|
62134
|
+
setupFilterButtonListener() {
|
|
62135
|
+
const columnId = this.params.column.getColId();
|
|
62136
|
+
this.filterButton = document.querySelector(`[col-id="${columnId}"] .ag-header-cell-filter-button`);
|
|
62137
|
+
if (this.filterButton) {
|
|
62138
|
+
this.filterButtonClickListener = (e) => {
|
|
62139
|
+
if (this.hasOpened) {
|
|
62140
|
+
e.stopPropagation();
|
|
62141
|
+
e.preventDefault();
|
|
62142
|
+
this.params.api.hidePopupMenu();
|
|
62143
|
+
this.hasOpened = false;
|
|
62144
|
+
}
|
|
62145
|
+
else {
|
|
62146
|
+
this.hasOpened = true;
|
|
62147
|
+
}
|
|
62148
|
+
};
|
|
62149
|
+
this.filterButton.addEventListener('click', this.filterButtonClickListener, true);
|
|
62150
|
+
}
|
|
62129
62151
|
}
|
|
62130
62152
|
render() {
|
|
62131
62153
|
if (!this.reactRoot)
|
|
@@ -62181,6 +62203,11 @@ class GridFilterColumnsMultiSelect {
|
|
|
62181
62203
|
this.render();
|
|
62182
62204
|
}
|
|
62183
62205
|
destroy() {
|
|
62206
|
+
if (this.filterButtonClickListener && this.filterButton) {
|
|
62207
|
+
this.filterButton.removeEventListener('click', this.filterButtonClickListener, true);
|
|
62208
|
+
this.filterButtonClickListener = null;
|
|
62209
|
+
this.filterButton = null;
|
|
62210
|
+
}
|
|
62184
62211
|
if (this.reactRoot) {
|
|
62185
62212
|
this.reactRoot.unmount();
|
|
62186
62213
|
this.reactRoot = null;
|
|
@@ -63795,16 +63822,22 @@ const GridPopoverEditBearingCorrection = (colDef, props) => GridPopoverEditBeari
|
|
|
63795
63822
|
},
|
|
63796
63823
|
});
|
|
63797
63824
|
|
|
63798
|
-
const GridPopoverEditDropDown = (colDef, props) =>
|
|
63799
|
-
|
|
63800
|
-
|
|
63801
|
-
|
|
63802
|
-
|
|
63803
|
-
|
|
63804
|
-
|
|
63805
|
-
|
|
63806
|
-
|
|
63807
|
-
|
|
63825
|
+
const GridPopoverEditDropDown = (colDef, props) => {
|
|
63826
|
+
colDef.cellRendererParams = {
|
|
63827
|
+
rightHoverElement: (jsxRuntime.jsx(GridIcon, { icon: 'ic_arrow_drop_down', title: '', className: 'GridCell-editableIcon GridCell-dropDownIcon' })),
|
|
63828
|
+
...colDef.cellRendererParams,
|
|
63829
|
+
};
|
|
63830
|
+
return GridCell(colDef, {
|
|
63831
|
+
editor: GridFormDropDown,
|
|
63832
|
+
...props,
|
|
63833
|
+
editorParams: {
|
|
63834
|
+
...props.editorParams,
|
|
63835
|
+
className: clsx({
|
|
63836
|
+
'GridPopoverEditDropDown-containerLarge': !props.editorParams?.className?.includes('GridPopoverEditDropDown-container'),
|
|
63837
|
+
}, props.editorParams?.className),
|
|
63838
|
+
},
|
|
63839
|
+
});
|
|
63840
|
+
};
|
|
63808
63841
|
|
|
63809
63842
|
const GridRenderPopoutMenuCell = (props) => {
|
|
63810
63843
|
const disabled = !fnOrVar(props.colDef?.editable, props);
|
|
@@ -63887,8 +63920,14 @@ const GridContextProvider = (props) => {
|
|
|
63887
63920
|
const enableMultilineBulkEditRef = React13.useRef(false);
|
|
63888
63921
|
const idsBeforeUpdate = React13.useRef([]);
|
|
63889
63922
|
const prePopupFocusedCell = React13.useRef();
|
|
63890
|
-
const [externallySelectedItemsAreInSync,
|
|
63923
|
+
const [externallySelectedItemsAreInSync, _setExternallySelectedItemsAreInSync] = React13.useState(false);
|
|
63891
63924
|
const externalFilters = React13.useRef([]);
|
|
63925
|
+
// waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
|
|
63926
|
+
const externallySelectedItemsAreInSyncRef = React13.useRef(false);
|
|
63927
|
+
const setExternallySelectedItemsAreInSync = React13.useCallback((cond) => {
|
|
63928
|
+
_setExternallySelectedItemsAreInSync(cond);
|
|
63929
|
+
externallySelectedItemsAreInSyncRef.current = cond;
|
|
63930
|
+
}, [_setExternallySelectedItemsAreInSync]);
|
|
63892
63931
|
const setQuickFilter = React13.useCallback((filter) => {
|
|
63893
63932
|
// If we don't clear the focused cell focus switches back to grid when typing in the quick filter input
|
|
63894
63933
|
gridApi?.clearFocusedCell();
|
|
@@ -64235,11 +64274,6 @@ const GridContextProvider = (props) => {
|
|
|
64235
64274
|
});
|
|
64236
64275
|
}
|
|
64237
64276
|
}, [gridApi]);
|
|
64238
|
-
// waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
|
|
64239
|
-
const externallySelectedItemsAreInSyncRef = React13.useRef(false);
|
|
64240
|
-
React13.useEffect(() => {
|
|
64241
|
-
externallySelectedItemsAreInSyncRef.current = externallySelectedItemsAreInSync;
|
|
64242
|
-
}, [externallySelectedItemsAreInSync]);
|
|
64243
64277
|
const waitForExternallySelectedItemsToBeInSync = React13.useCallback(async () => {
|
|
64244
64278
|
if (!hasExternallySelectedItemsRef.current) {
|
|
64245
64279
|
externallySelectedItemsAreInSyncRef.current = true;
|
|
@@ -64295,7 +64329,7 @@ const GridContextProvider = (props) => {
|
|
|
64295
64329
|
finally {
|
|
64296
64330
|
startCellEditingInProgressRef.current = false;
|
|
64297
64331
|
}
|
|
64298
|
-
}, [anyUpdating, gridApi, prePopupOps, waitForExternallySelectedItemsToBeInSync]);
|
|
64332
|
+
}, [anyUpdating, gridApi, prePopupOps, setExternallySelectedItemsAreInSync, waitForExternallySelectedItemsToBeInSync]);
|
|
64299
64333
|
const bulkEditingCompleteCallbackRef = React13.useRef();
|
|
64300
64334
|
const onBulkEditingComplete = React13.useCallback(async () => {
|
|
64301
64335
|
await bulkEditingCompleteCallbackRef.current?.();
|