@bigbinary/neeto-atoms 1.0.110 → 1.0.111

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.
@@ -3731,7 +3731,7 @@ const useColumnResize = ({
3731
3731
  });
3732
3732
  if (autoDefaultTotal === 0) return;
3733
3733
  const autoAvailable = availableWidth - userResizedTotal;
3734
- const scale = autoAvailable > 0 ? autoAvailable / autoDefaultTotal : 0;
3734
+ const scale = autoAvailable > autoDefaultTotal ? autoAvailable / autoDefaultTotal : 1;
3735
3735
  const newSizing = {};
3736
3736
  let changed = false;
3737
3737
  leafColumns.forEach((col) => {
@@ -3739,13 +3739,20 @@ const useColumnResize = ({
3739
3739
  newSizing[col.id] = columnSizing[col.id] ?? col.columnDef.size ?? 150;
3740
3740
  } else {
3741
3741
  const defaultSize = col.columnDef.size ?? 150;
3742
- const newSize = scale > 0 ? Math.floor(defaultSize * scale) : defaultSize;
3742
+ const scaledSize = Math.floor(defaultSize * scale);
3743
+ const newSize = col.columnDef.maxSize ? Math.min(scaledSize, col.columnDef.maxSize) : scaledSize;
3743
3744
  if (newSize !== (columnSizing[col.id] ?? -1)) changed = true;
3744
3745
  newSizing[col.id] = newSize;
3745
3746
  }
3746
3747
  });
3747
3748
  if (changed) setColumnSizing((prev) => ({ ...prev, ...newSizing }));
3748
- }, [containerWidth, enabled, columnsKey, columnVisibility, hasSelectionColumn]);
3749
+ }, [
3750
+ containerWidth,
3751
+ enabled,
3752
+ columnsKey,
3753
+ columnVisibility,
3754
+ hasSelectionColumn
3755
+ ]);
3749
3756
  const lastDataColumnId = enabled ? (() => {
3750
3757
  const dataCols = table.getVisibleLeafColumns().filter((col) => col.id !== "_selection");
3751
3758
  const lastNonPinned = dataCols.filter((col) => !col.getIsPinned()).at(-1);
@@ -4585,4 +4592,4 @@ const DataTable = ({
4585
4592
  };
4586
4593
 
4587
4594
  export { DataTable as D, useColumnPinning as a, useColumnVisibility as b, useTablePagination as c, useTableSelection as d, useTableSort as e, useColumnOrdering as u };
4588
- //# sourceMappingURL=DataTable-Dhqp51p8.js.map
4595
+ //# sourceMappingURL=DataTable-X455U4hi.js.map