@linzjs/step-ag-grid 14.4.0 → 14.5.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/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
|
|
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), updatedDep = _m.updatedDep, updatingCols = _m.updatingCols;
|
|
726
726
|
var gridContext = useContext(GridContext);
|
|
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.
|
|
@@ -1042,8 +1042,11 @@ var Grid = function (_a) {
|
|
|
1042
1042
|
* but we don't want the non-flex auto-sized columns to "fit" size, so suppressSizeToFit is set to true.
|
|
1043
1043
|
*/
|
|
1044
1044
|
var columnDefsAdjusted = useMemo(function () {
|
|
1045
|
-
return columnDefs.map(function (colDef) {
|
|
1046
|
-
|
|
1045
|
+
return columnDefs.map(function (colDef) {
|
|
1046
|
+
var _a;
|
|
1047
|
+
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 }));
|
|
1048
|
+
});
|
|
1049
|
+
}, [columnDefs, (_d = params.defaultColDef) === null || _d === void 0 ? void 0 : _d.sortable, sizeColumns]);
|
|
1047
1050
|
/**
|
|
1048
1051
|
* Set of colIds that need auto-sizing.
|
|
1049
1052
|
*/
|
|
@@ -1117,7 +1120,7 @@ var Grid = function (_a) {
|
|
|
1117
1120
|
}, 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
1121
|
rowData: params.rowData,
|
|
1119
1122
|
noRowsOverlayText: params.noRowsOverlayText
|
|
1120
|
-
}, onModelUpdated: onModelUpdated, onGridReady: onGridReady, onSortChanged: ensureSelectedRowIsVisible, postSortRows: (
|
|
1123
|
+
}, 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
1124
|
};
|
|
1122
1125
|
|
|
1123
1126
|
var GridPopoverContext = createContext({
|
|
@@ -4946,18 +4949,18 @@ var GridContextProvider = function (props) {
|
|
|
4946
4949
|
colDef = gridApi.getColumnDef(colId);
|
|
4947
4950
|
if (!colDef)
|
|
4948
4951
|
return [2 /*return*/];
|
|
4949
|
-
|
|
4950
|
-
if (checkUpdating([(_b = colDef.field) !== null && _b !== void 0 ? _b : ""], rowId)) {
|
|
4951
|
-
return [2 /*return*/];
|
|
4952
|
-
}
|
|
4952
|
+
prePopupOps();
|
|
4953
4953
|
rowNode = gridApi.getRowNode("".concat(rowId));
|
|
4954
4954
|
if (!rowNode) {
|
|
4955
4955
|
return [2 /*return*/];
|
|
4956
4956
|
}
|
|
4957
4957
|
if (!rowNode.isSelected()) {
|
|
4958
|
-
rowNode.setSelected(true,
|
|
4958
|
+
rowNode.setSelected(true, false);
|
|
4959
|
+
}
|
|
4960
|
+
// Cell already being edited, so don't re-edit until finished
|
|
4961
|
+
if (checkUpdating([(_b = colDef.field) !== null && _b !== void 0 ? _b : ""], rowId)) {
|
|
4962
|
+
return [2 /*return*/];
|
|
4959
4963
|
}
|
|
4960
|
-
prePopupOps();
|
|
4961
4964
|
rowIndex = rowNode.rowIndex;
|
|
4962
4965
|
if (rowIndex != null) {
|
|
4963
4966
|
focusAndEdit = function () {
|