@alaarab/ogrid-react 2.0.13 → 2.0.15

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.
@@ -327,10 +327,12 @@ export function useDataGridState(params) {
327
327
  flatColumns, visibleCols, visibleColumnCount, totalColCount, colOffset,
328
328
  hasCheckboxCol, hasRowNumbersCol, rowIndexByRowId, containerWidth, minTableWidth,
329
329
  desiredTableWidth, columnSizingOverrides, setColumnSizingOverrides, onColumnResized,
330
+ measuredColumnWidths,
330
331
  }), [
331
332
  flatColumns, visibleCols, visibleColumnCount, totalColCount, colOffset,
332
333
  hasCheckboxCol, hasRowNumbersCol, rowIndexByRowId, containerWidth, minTableWidth,
333
334
  desiredTableWidth, columnSizingOverrides, setColumnSizingOverrides, onColumnResized,
335
+ measuredColumnWidths,
334
336
  ]);
335
337
  const rowSelectionState = useMemo(() => ({
336
338
  selectedRowIds, updateSelection, handleRowCheckboxChange,
@@ -25,7 +25,7 @@ export function useDataGridTableOrchestration(params) {
25
25
  // ── Core state ──────────────────────────────────────────────────────────
26
26
  const state = useDataGridState({ props, wrapperRef });
27
27
  const { layout, rowSelection: rowSel, editing, interaction, contextMenu: ctxMenu, viewModels, pinning } = state;
28
- const { visibleCols: visibleColsTyped, totalColCount, hasCheckboxCol, hasRowNumbersCol, colOffset, containerWidth, minTableWidth, desiredTableWidth, columnSizingOverrides, setColumnSizingOverrides, } = layout;
28
+ const { visibleCols: visibleColsTyped, totalColCount, hasCheckboxCol, hasRowNumbersCol, colOffset, containerWidth, minTableWidth, desiredTableWidth, columnSizingOverrides, setColumnSizingOverrides, measuredColumnWidths, } = layout;
29
29
  const visibleCols = visibleColsTyped;
30
30
  const { selectedRowIds, updateSelection, handleRowCheckboxChange, handleSelectAll, allSelected, someSelected } = rowSel;
31
31
  const { editingCell, setEditingCell, pendingEditorValue, setPendingEditorValue, commitCellEdit, cancelPopoverEdit, popoverAnchorEl, setPopoverAnchorEl } = editing;
@@ -158,6 +158,7 @@ export function useDataGridTableOrchestration(params) {
158
158
  desiredTableWidth,
159
159
  columnSizingOverrides,
160
160
  setColumnSizingOverrides,
161
+ measuredColumnWidths,
161
162
  // Row selection shortcuts
162
163
  selectedRowIds,
163
164
  updateSelection,
@@ -25,6 +25,10 @@ export interface DataGridLayoutState<T> {
25
25
  widthPx: number;
26
26
  }>>>;
27
27
  onColumnResized?: (columnId: string, width: number) => void;
28
+ /** DOM-measured column widths from the previous layout pass.
29
+ * UI packages use these as a minWidth floor to prevent columns from
30
+ * shrinking when new data loads (e.g. during server-side pagination). */
31
+ measuredColumnWidths: Record<string, number>;
28
32
  }
29
33
  /** Row selection (checkboxes, single-row click). */
30
34
  export interface DataGridRowSelectionState {
@@ -87,6 +87,7 @@ export interface UseDataGridTableOrchestrationResult<T> {
87
87
  setColumnSizingOverrides: React.Dispatch<React.SetStateAction<Record<string, {
88
88
  widthPx: number;
89
89
  }>>>;
90
+ measuredColumnWidths: Record<string, number>;
90
91
  selectedRowIds: Set<RowId>;
91
92
  updateSelection: DataGridRowSelectionState['updateSelection'];
92
93
  handleRowCheckboxChange: DataGridRowSelectionState['handleRowCheckboxChange'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alaarab/ogrid-react",
3
- "version": "2.0.13",
3
+ "version": "2.0.15",
4
4
  "description": "OGrid React – React hooks, headless components, and utilities for OGrid data grids.",
5
5
  "main": "dist/esm/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -36,7 +36,7 @@
36
36
  "node": ">=18"
37
37
  },
38
38
  "dependencies": {
39
- "@alaarab/ogrid-core": "2.0.13"
39
+ "@alaarab/ogrid-core": "2.0.15"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "@tanstack/react-virtual": "^3.0.0",