@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.
- package/dist/GridTheme.scss +12 -0
- package/dist/src/components/gridFilter/GridFilterColumnsMultiSelect.d.ts +0 -1
- package/dist/step-ag-grid.cjs +40 -22
- package/dist/step-ag-grid.cjs.map +1 -1
- package/dist/step-ag-grid.esm.js +40 -22
- package/dist/step-ag-grid.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/gridFilter/GridFilterColumnsMultiSelect.tsx +18 -5
- package/src/components/gridPopoverEdit/{GridPopoverEditDropDown.ts → GridPopoverEditDropDown.tsx} +10 -2
- package/src/contexts/GridContextProvider.tsx +13 -8
- 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;
|
|
@@ -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;
|
package/dist/step-ag-grid.cjs
CHANGED
|
@@ -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
|
-
|
|
62140
|
-
|
|
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
|
-
|
|
62154
|
+
filterStateMap.set(columnId, false);
|
|
62144
62155
|
}
|
|
62145
62156
|
else {
|
|
62146
|
-
|
|
62157
|
+
filterStateMap.set(columnId, true);
|
|
62147
62158
|
}
|
|
62148
62159
|
};
|
|
62149
62160
|
this.filterButton.addEventListener('click', this.filterButtonClickListener, true);
|
|
@@ -63822,16 +63833,22 @@ const GridPopoverEditBearingCorrection = (colDef, props) => GridPopoverEditBeari
|
|
|
63822
63833
|
},
|
|
63823
63834
|
});
|
|
63824
63835
|
|
|
63825
|
-
const GridPopoverEditDropDown = (colDef, props) =>
|
|
63826
|
-
|
|
63827
|
-
|
|
63828
|
-
|
|
63829
|
-
|
|
63830
|
-
|
|
63831
|
-
|
|
63832
|
-
|
|
63833
|
-
|
|
63834
|
-
|
|
63836
|
+
const GridPopoverEditDropDown = (colDef, props) => {
|
|
63837
|
+
colDef.cellRendererParams = {
|
|
63838
|
+
rightHoverElement: (jsxRuntime.jsx(GridIcon, { icon: 'ic_arrow_drop_down', title: '', className: 'GridCell-editableIcon GridCell-dropDownIcon' })),
|
|
63839
|
+
...colDef.cellRendererParams,
|
|
63840
|
+
};
|
|
63841
|
+
return GridCell(colDef, {
|
|
63842
|
+
editor: GridFormDropDown,
|
|
63843
|
+
...props,
|
|
63844
|
+
editorParams: {
|
|
63845
|
+
...props.editorParams,
|
|
63846
|
+
className: clsx({
|
|
63847
|
+
'GridPopoverEditDropDown-containerLarge': !props.editorParams?.className?.includes('GridPopoverEditDropDown-container'),
|
|
63848
|
+
}, props.editorParams?.className),
|
|
63849
|
+
},
|
|
63850
|
+
});
|
|
63851
|
+
};
|
|
63835
63852
|
|
|
63836
63853
|
const GridRenderPopoutMenuCell = (props) => {
|
|
63837
63854
|
const disabled = !fnOrVar(props.colDef?.editable, props);
|
|
@@ -63914,8 +63931,14 @@ const GridContextProvider = (props) => {
|
|
|
63914
63931
|
const enableMultilineBulkEditRef = React13.useRef(false);
|
|
63915
63932
|
const idsBeforeUpdate = React13.useRef([]);
|
|
63916
63933
|
const prePopupFocusedCell = React13.useRef();
|
|
63917
|
-
const [externallySelectedItemsAreInSync,
|
|
63934
|
+
const [externallySelectedItemsAreInSync, _setExternallySelectedItemsAreInSync] = React13.useState(false);
|
|
63918
63935
|
const externalFilters = React13.useRef([]);
|
|
63936
|
+
// waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
|
|
63937
|
+
const externallySelectedItemsAreInSyncRef = React13.useRef(false);
|
|
63938
|
+
const setExternallySelectedItemsAreInSync = React13.useCallback((cond) => {
|
|
63939
|
+
_setExternallySelectedItemsAreInSync(cond);
|
|
63940
|
+
externallySelectedItemsAreInSyncRef.current = cond;
|
|
63941
|
+
}, [_setExternallySelectedItemsAreInSync]);
|
|
63919
63942
|
const setQuickFilter = React13.useCallback((filter) => {
|
|
63920
63943
|
// If we don't clear the focused cell focus switches back to grid when typing in the quick filter input
|
|
63921
63944
|
gridApi?.clearFocusedCell();
|
|
@@ -64262,11 +64285,6 @@ const GridContextProvider = (props) => {
|
|
|
64262
64285
|
});
|
|
64263
64286
|
}
|
|
64264
64287
|
}, [gridApi]);
|
|
64265
|
-
// waitForExternallySelectedItemsToBeInSync can't use the state as it won't be updated during function execution
|
|
64266
|
-
const externallySelectedItemsAreInSyncRef = React13.useRef(false);
|
|
64267
|
-
React13.useEffect(() => {
|
|
64268
|
-
externallySelectedItemsAreInSyncRef.current = externallySelectedItemsAreInSync;
|
|
64269
|
-
}, [externallySelectedItemsAreInSync]);
|
|
64270
64288
|
const waitForExternallySelectedItemsToBeInSync = React13.useCallback(async () => {
|
|
64271
64289
|
if (!hasExternallySelectedItemsRef.current) {
|
|
64272
64290
|
externallySelectedItemsAreInSyncRef.current = true;
|
|
@@ -64322,7 +64340,7 @@ const GridContextProvider = (props) => {
|
|
|
64322
64340
|
finally {
|
|
64323
64341
|
startCellEditingInProgressRef.current = false;
|
|
64324
64342
|
}
|
|
64325
|
-
}, [anyUpdating, gridApi, prePopupOps, waitForExternallySelectedItemsToBeInSync]);
|
|
64343
|
+
}, [anyUpdating, gridApi, prePopupOps, setExternallySelectedItemsAreInSync, waitForExternallySelectedItemsToBeInSync]);
|
|
64326
64344
|
const bulkEditingCompleteCallbackRef = React13.useRef();
|
|
64327
64345
|
const onBulkEditingComplete = React13.useCallback(async () => {
|
|
64328
64346
|
await bulkEditingCompleteCallbackRef.current?.();
|