@linzjs/step-ag-grid 14.4.0 → 14.5.1
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/step-ag-grid.esm.js
CHANGED
|
@@ -719,14 +719,14 @@ var GridHeaderSelect = function (_a) {
|
|
|
719
719
|
* Wrapper for AgGrid to add commonly used functionality.
|
|
720
720
|
*/
|
|
721
721
|
var Grid = function (_a) {
|
|
722
|
-
var _b, _c, _d;
|
|
723
|
-
var dataTestId = _a["data-testid"],
|
|
724
|
-
var
|
|
725
|
-
var
|
|
726
|
-
var
|
|
722
|
+
var _b, _c, _d, _e;
|
|
723
|
+
var dataTestId = _a["data-testid"], _f = _a.rowSelection, rowSelection = _f === void 0 ? "multiple" : _f, _g = _a.suppressColumnVirtualization, suppressColumnVirtualization = _g === void 0 ? true : _g, _h = _a.theme, theme = _h === void 0 ? "ag-theme-alpine" : _h, _j = _a.sizeColumns, sizeColumns = _j === void 0 ? "auto" : _j, _k = _a.selectColumnPinned, selectColumnPinned = _k === void 0 ? null : _k, params = __rest(_a, ["data-testid", "rowSelection", "suppressColumnVirtualization", "theme", "sizeColumns", "selectColumnPinned"]);
|
|
724
|
+
var _l = useContext(GridContext), gridReady = _l.gridReady, setApis = _l.setApis, ensureRowVisible = _l.ensureRowVisible, getFirstRowId = _l.getFirstRowId, selectRowsById = _l.selectRowsById, focusByRowById = _l.focusByRowById, ensureSelectedRowIsVisible = _l.ensureSelectedRowIsVisible, autoSizeColumns = _l.autoSizeColumns, sizeColumnsToFit = _l.sizeColumnsToFit, externallySelectedItemsAreInSync = _l.externallySelectedItemsAreInSync, setExternallySelectedItemsAreInSync = _l.setExternallySelectedItemsAreInSync, isExternalFilterPresent = _l.isExternalFilterPresent, doesExternalFilterPass = _l.doesExternalFilterPass, setOnCellEditingComplete = _l.setOnCellEditingComplete, getColDef = _l.getColDef;
|
|
725
|
+
var _m = useContext(GridUpdatingContext), checkUpdating = _m.checkUpdating, updatedDep = _m.updatedDep, updatingCols = _m.updatingCols;
|
|
726
|
+
var prePopupOps = useContext(GridContext).prePopupOps;
|
|
727
727
|
var gridDivRef = useRef(null);
|
|
728
728
|
var lastSelectedIds = useRef([]);
|
|
729
|
-
var
|
|
729
|
+
var _o = useState(false), staleGrid = _o[0], setStaleGrid = _o[1];
|
|
730
730
|
var postSortRows = usePostSortRowsHook({ setStaleGrid: setStaleGrid });
|
|
731
731
|
/**
|
|
732
732
|
* onContentSize should only be called at maximum twice.
|
|
@@ -989,12 +989,22 @@ var Grid = function (_a) {
|
|
|
989
989
|
* Make sure node is selected for editing and start edit
|
|
990
990
|
*/
|
|
991
991
|
var startCellEditing = useCallback(function (event) {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
992
|
+
var _a;
|
|
993
|
+
prePopupOps();
|
|
994
|
+
if (!event.node.isSelected()) {
|
|
995
|
+
event.node.setSelected(true, true);
|
|
996
|
+
}
|
|
997
|
+
// Cell already being edited, so don't re-edit until finished
|
|
998
|
+
if (checkUpdating([(_a = event.colDef.field) !== null && _a !== void 0 ? _a : ""], event.data.id)) {
|
|
999
|
+
return;
|
|
1000
|
+
}
|
|
1001
|
+
if (event.rowIndex !== null) {
|
|
1002
|
+
event.api.startEditingCell({
|
|
1003
|
+
rowIndex: event.rowIndex,
|
|
1004
|
+
colKey: event.column.getColId()
|
|
996
1005
|
});
|
|
997
|
-
|
|
1006
|
+
}
|
|
1007
|
+
}, [checkUpdating, prePopupOps]);
|
|
998
1008
|
/**
|
|
999
1009
|
* Handle double click edit
|
|
1000
1010
|
*/
|
|
@@ -1042,8 +1052,11 @@ var Grid = function (_a) {
|
|
|
1042
1052
|
* but we don't want the non-flex auto-sized columns to "fit" size, so suppressSizeToFit is set to true.
|
|
1043
1053
|
*/
|
|
1044
1054
|
var columnDefsAdjusted = useMemo(function () {
|
|
1045
|
-
return columnDefs.map(function (colDef) {
|
|
1046
|
-
|
|
1055
|
+
return columnDefs.map(function (colDef) {
|
|
1056
|
+
var _a;
|
|
1057
|
+
return (__assign(__assign({}, colDef), { suppressSizeToFit: (sizeColumns === "auto" || sizeColumns === "auto-skip-headers") && !colDef.flex, sortable: colDef.sortable && ((_a = params.defaultColDef) === null || _a === void 0 ? void 0 : _a.sortable) !== false }));
|
|
1058
|
+
});
|
|
1059
|
+
}, [columnDefs, (_d = params.defaultColDef) === null || _d === void 0 ? void 0 : _d.sortable, sizeColumns]);
|
|
1047
1060
|
/**
|
|
1048
1061
|
* Set of colIds that need auto-sizing.
|
|
1049
1062
|
*/
|
|
@@ -1117,7 +1130,7 @@ var Grid = function (_a) {
|
|
|
1117
1130
|
}, onRowDataChanged: onRowDataChanged, onCellKeyPress: onCellKeyPress, onCellClicked: onCellClicked, onCellDoubleClicked: onCellDoubleClick, onCellEditingStarted: refreshSelectedRows, domLayout: params.domLayout, onColumnResized: onColumnResized, defaultColDef: __assign({ minWidth: 48 }, omit(params.defaultColDef, ["editable"])), columnDefs: columnDefsAdjusted, rowData: params.rowData, noRowsOverlayComponent: GridNoRowsOverlay, noRowsOverlayComponentParams: {
|
|
1118
1131
|
rowData: params.rowData,
|
|
1119
1132
|
noRowsOverlayText: params.noRowsOverlayText
|
|
1120
|
-
}, onModelUpdated: onModelUpdated, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, postSortRows: (
|
|
1133
|
+
}, onModelUpdated: onModelUpdated, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, postSortRows: (_e = params.postSortRows) !== null && _e !== void 0 ? _e : postSortRows, onSelectionChanged: synchroniseExternalStateToGridSelection, onColumnMoved: params.onColumnMoved, alwaysShowVerticalScroll: params.alwaysShowVerticalScroll, isExternalFilterPresent: isExternalFilterPresent, doesExternalFilterPass: doesExternalFilterPass, maintainColumnOrder: true }) })) })));
|
|
1121
1134
|
};
|
|
1122
1135
|
|
|
1123
1136
|
var GridPopoverContext = createContext({
|
|
@@ -4946,18 +4959,18 @@ var GridContextProvider = function (props) {
|
|
|
4946
4959
|
colDef = gridApi.getColumnDef(colId);
|
|
4947
4960
|
if (!colDef)
|
|
4948
4961
|
return [2 /*return*/];
|
|
4949
|
-
|
|
4950
|
-
if (checkUpdating([(_b = colDef.field) !== null && _b !== void 0 ? _b : ""], rowId)) {
|
|
4951
|
-
return [2 /*return*/];
|
|
4952
|
-
}
|
|
4962
|
+
prePopupOps();
|
|
4953
4963
|
rowNode = gridApi.getRowNode("".concat(rowId));
|
|
4954
4964
|
if (!rowNode) {
|
|
4955
4965
|
return [2 /*return*/];
|
|
4956
4966
|
}
|
|
4957
4967
|
if (!rowNode.isSelected()) {
|
|
4958
|
-
rowNode.setSelected(true,
|
|
4968
|
+
rowNode.setSelected(true, false);
|
|
4969
|
+
}
|
|
4970
|
+
// Cell already being edited, so don't re-edit until finished
|
|
4971
|
+
if (checkUpdating([(_b = colDef.field) !== null && _b !== void 0 ? _b : ""], rowId)) {
|
|
4972
|
+
return [2 /*return*/];
|
|
4959
4973
|
}
|
|
4960
|
-
prePopupOps();
|
|
4961
4974
|
rowIndex = rowNode.rowIndex;
|
|
4962
4975
|
if (rowIndex != null) {
|
|
4963
4976
|
focusAndEdit = function () {
|