asma-ui-table 1.4.3 → 1.5.0

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.
@@ -14118,13 +14118,18 @@ const StyledTable = (props) => {
14118
14118
  };
14119
14119
  }, [canShowStickyFooter, tableXRef, tableScrollRef]);
14120
14120
  const { ref: containerRef, heightPx: rowsAreaPx } = useElementHeightPx();
14121
+ const { ref: inlineFooterRef, heightPx: inlineFooterHeightPx } = useElementHeightPx();
14121
14122
  const rowHeightPx = options.rowHeight ?? 48;
14122
14123
  const visibleRows = table.getRowModel().rows.length;
14124
+ const inlineHeaderHeightPx = options.hideHeader ? 0 : 32;
14125
+ const inlineHScrollHeightPx = 12;
14123
14126
  const rowsFit = useMemo(() => {
14124
14127
  if (rowHeightPx <= 0)
14125
14128
  return 0;
14126
- return Math.floor(rowsAreaPx / rowHeightPx);
14127
- }, [rowsAreaPx, rowHeightPx]);
14129
+ const reservedHeightPx = canShowStickyFooter ? 0 : inlineHeaderHeightPx + inlineFooterHeightPx + inlineHScrollHeightPx;
14130
+ const availableRowsAreaPx = Math.max(0, rowsAreaPx - reservedHeightPx);
14131
+ return Math.floor(availableRowsAreaPx / rowHeightPx);
14132
+ }, [canShowStickyFooter, inlineFooterHeightPx, inlineHeaderHeightPx, inlineHScrollHeightPx, rowHeightPx, rowsAreaPx]);
14128
14133
  const isShortTable = !canShowStickyFooter && visibleRows > 0 && visibleRows <= rowsFit;
14129
14134
  const shouldExpandEmptyBody = !canShowStickyFooter && showNoRowsOverlay;
14130
14135
  const tableWrapperClass = cn(
@@ -14192,6 +14197,7 @@ const StyledTable = (props) => {
14192
14197
  /* @__PURE__ */ jsx(
14193
14198
  "div",
14194
14199
  {
14200
+ ref: inlineFooterRef,
14195
14201
  className: cn(
14196
14202
  style$1["table-bottom"],
14197
14203
  isShortTable && style$1["table-bottom--sticky"]
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.4.3",
6
+ "version": "1.5.0",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "dist/**/*",