@bigbinary/neeto-atoms 1.0.109 → 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);
@@ -3965,7 +3972,7 @@ const HeaderCellMenu = ({
3965
3972
  const enableDelete = meta?.enableDelete === true;
3966
3973
  const moreActions = meta?.moreActions ?? [];
3967
3974
  const currentSort = column.getIsSorted();
3968
- const hasAnyAction = isSortable || isHidable || enableAddColumn || enableColumnFreeze && column.getCanPin() || enableDelete || onMoveColumn && (canMoveLeft || canMoveRight) || moreActions.length > 0;
3975
+ const hasAnyAction = isSortable || isHidable && !!onHideColumn || enableAddColumn || enableColumnFreeze && column.getCanPin() || enableDelete && !!onDeleteColumn || onMoveColumn && (canMoveLeft || canMoveRight) || moreActions.length > 0;
3969
3976
  if (!hasAnyAction) return null;
3970
3977
  return /* @__PURE__ */ jsx("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxs(DropdownMenu, { children: [
3971
3978
  /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
@@ -4157,7 +4164,7 @@ const DataTable = ({
4157
4164
  persistColumnSizing = false,
4158
4165
  columnSizing: columnSizingProp,
4159
4166
  onColumnSizingChange: onColumnSizingChangeProp,
4160
- enableColumnFreeze = true,
4167
+ enableColumnFreeze = false,
4161
4168
  columnPinning: columnPinningProp,
4162
4169
  onColumnPinningChange: onColumnPinningChangeProp,
4163
4170
  localStorageKeyPrefix,
@@ -4241,7 +4248,7 @@ const DataTable = ({
4241
4248
  columnOrder: columnOrderProp,
4242
4249
  onColumnOrderChange: onColumnOrderChangeProp
4243
4250
  });
4244
- const showHeaderMenu = enableHeaderMenu ?? (enableColumnFreeze || enableAddColumn || !!onColumnHideProp || !!onColumnDelete || !!onColumnUpdate || !!onMoreActionClick);
4251
+ const showHeaderMenu = enableHeaderMenu ?? (enableSorting || enableColumnFreeze || enableAddColumn || !!onColumnHideProp || !!onColumnDelete || !!onColumnUpdate || !!onMoreActionClick);
4245
4252
  const allColumns = useMemo(() => {
4246
4253
  const cols = enableColumnResize ? columns.map((col) => ({
4247
4254
  ...col,
@@ -4480,7 +4487,7 @@ const DataTable = ({
4480
4487
  /* @__PURE__ */ jsx(HeaderDescription, { column: header.column })
4481
4488
  ] }),
4482
4489
  /* @__PURE__ */ jsx(SortIndicator, { column: header.column }),
4483
- showHeaderMenu && !isSelectionCol && /* @__PURE__ */ jsx(
4490
+ showHeaderMenu && /* @__PURE__ */ jsx(
4484
4491
  HeaderCellMenu,
4485
4492
  {
4486
4493
  column: header.column,
@@ -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-Bw8nx-uK.js.map
4595
+ //# sourceMappingURL=DataTable-X455U4hi.js.map