@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.
@@ -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);
@@ -3986,7 +3993,7 @@ const HeaderCellMenu = ({
3986
3993
  const enableDelete = meta?.enableDelete === true;
3987
3994
  const moreActions = meta?.moreActions ?? [];
3988
3995
  const currentSort = column.getIsSorted();
3989
- const hasAnyAction = isSortable || isHidable || enableAddColumn || enableColumnFreeze && column.getCanPin() || enableDelete || onMoveColumn && (canMoveLeft || canMoveRight) || moreActions.length > 0;
3996
+ const hasAnyAction = isSortable || isHidable && !!onHideColumn || enableAddColumn || enableColumnFreeze && column.getCanPin() || enableDelete && !!onDeleteColumn || onMoveColumn && (canMoveLeft || canMoveRight) || moreActions.length > 0;
3990
3997
  if (!hasAnyAction) return null;
3991
3998
  return /* @__PURE__ */ jsxRuntime.jsx("div", { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsxs(primitives_DropdownMenu.DropdownMenu, { children: [
3992
3999
  /* @__PURE__ */ jsxRuntime.jsx(primitives_DropdownMenu.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
@@ -4178,7 +4185,7 @@ const DataTable = ({
4178
4185
  persistColumnSizing = false,
4179
4186
  columnSizing: columnSizingProp,
4180
4187
  onColumnSizingChange: onColumnSizingChangeProp,
4181
- enableColumnFreeze = true,
4188
+ enableColumnFreeze = false,
4182
4189
  columnPinning: columnPinningProp,
4183
4190
  onColumnPinningChange: onColumnPinningChangeProp,
4184
4191
  localStorageKeyPrefix,
@@ -4262,7 +4269,7 @@ const DataTable = ({
4262
4269
  columnOrder: columnOrderProp,
4263
4270
  onColumnOrderChange: onColumnOrderChangeProp
4264
4271
  });
4265
- const showHeaderMenu = enableHeaderMenu ?? (enableColumnFreeze || enableAddColumn || !!onColumnHideProp || !!onColumnDelete || !!onColumnUpdate || !!onMoreActionClick);
4272
+ const showHeaderMenu = enableHeaderMenu ?? (enableSorting || enableColumnFreeze || enableAddColumn || !!onColumnHideProp || !!onColumnDelete || !!onColumnUpdate || !!onMoreActionClick);
4266
4273
  const allColumns = React.useMemo(() => {
4267
4274
  const cols = enableColumnResize ? columns.map((col) => ({
4268
4275
  ...col,
@@ -4501,7 +4508,7 @@ const DataTable = ({
4501
4508
  /* @__PURE__ */ jsxRuntime.jsx(HeaderDescription, { column: header.column })
4502
4509
  ] }),
4503
4510
  /* @__PURE__ */ jsxRuntime.jsx(SortIndicator, { column: header.column }),
4504
- showHeaderMenu && !isSelectionCol && /* @__PURE__ */ jsxRuntime.jsx(
4511
+ showHeaderMenu && /* @__PURE__ */ jsxRuntime.jsx(
4505
4512
  HeaderCellMenu,
4506
4513
  {
4507
4514
  column: header.column,
@@ -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-7OC5qqoG.js.map
4622
+ //# sourceMappingURL=DataTable-CnMgor8P.js.map