@bigbinary/neeto-atoms 1.0.110 → 1.0.112

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.
@@ -3752,7 +3752,7 @@ const useColumnResize = ({
3752
3752
  });
3753
3753
  if (autoDefaultTotal === 0) return;
3754
3754
  const autoAvailable = availableWidth - userResizedTotal;
3755
- const scale = autoAvailable > 0 ? autoAvailable / autoDefaultTotal : 0;
3755
+ const scale = autoAvailable > autoDefaultTotal ? autoAvailable / autoDefaultTotal : 1;
3756
3756
  const newSizing = {};
3757
3757
  let changed = false;
3758
3758
  leafColumns.forEach((col) => {
@@ -3760,13 +3760,20 @@ const useColumnResize = ({
3760
3760
  newSizing[col.id] = columnSizing[col.id] ?? col.columnDef.size ?? 150;
3761
3761
  } else {
3762
3762
  const defaultSize = col.columnDef.size ?? 150;
3763
- const newSize = scale > 0 ? Math.floor(defaultSize * scale) : defaultSize;
3763
+ const scaledSize = Math.floor(defaultSize * scale);
3764
+ const newSize = col.columnDef.maxSize ? Math.min(scaledSize, col.columnDef.maxSize) : scaledSize;
3764
3765
  if (newSize !== (columnSizing[col.id] ?? -1)) changed = true;
3765
3766
  newSizing[col.id] = newSize;
3766
3767
  }
3767
3768
  });
3768
3769
  if (changed) setColumnSizing((prev) => ({ ...prev, ...newSizing }));
3769
- }, [containerWidth, enabled, columnsKey, columnVisibility, hasSelectionColumn]);
3770
+ }, [
3771
+ containerWidth,
3772
+ enabled,
3773
+ columnsKey,
3774
+ columnVisibility,
3775
+ hasSelectionColumn
3776
+ ]);
3770
3777
  const lastDataColumnId = enabled ? (() => {
3771
3778
  const dataCols = table.getVisibleLeafColumns().filter((col) => col.id !== "_selection");
3772
3779
  const lastNonPinned = dataCols.filter((col) => !col.getIsPinned()).at(-1);
@@ -4612,4 +4619,4 @@ exports.useColumnVisibility = useColumnVisibility;
4612
4619
  exports.useTablePagination = useTablePagination;
4613
4620
  exports.useTableSelection = useTableSelection;
4614
4621
  exports.useTableSort = useTableSort;
4615
- //# sourceMappingURL=DataTable-BpX59uHL.js.map
4622
+ //# sourceMappingURL=DataTable-CnMgor8P.js.map